1 | /* $Id: VBoxOGL.h 82968 2020-02-04 10:35:17Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox 3D Support API
|
---|
4 | */
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2012-2020 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef VBOX_INCLUDED_VBoxOGL_h
|
---|
27 | #define VBOX_INCLUDED_VBoxOGL_h
|
---|
28 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
29 | # pragma once
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #include <iprt/cdefs.h>
|
---|
33 | #include <iprt/types.h>
|
---|
34 |
|
---|
35 | RT_C_DECLS_BEGIN
|
---|
36 |
|
---|
37 | /* GUI and VBox OpenGL code require scaling factor value to be stored in container
|
---|
38 | * of type of 'double'. Communication between them is done via Main. In the same time,
|
---|
39 | * currently, Main does not like type of 'double' to be used for an interface method parameter.
|
---|
40 | * An integer type should be used instead. This value is used in order to specify scaling factor in type
|
---|
41 | * of 'integer' units. It is assumed that GUI feeds Main with its internal scaling factor value
|
---|
42 | * (which is originally of type of 'double') multiplied by this constant and converted resulting
|
---|
43 | * value to type of 'uint32_t'. Then Main provides this data to OpenGL HGCM thread. Finally, VBox OpenGL
|
---|
44 | * code divides received scalar by this constant and converts result to type of 'double'.
|
---|
45 | * This constant can be increased (multiplied by 10^n) in order to get better precision
|
---|
46 | * for scaling factor manipulations. */
|
---|
47 | #define VBOX_OGL_SCALE_FACTOR_MULTIPLIER 10000.0
|
---|
48 |
|
---|
49 | /* 3D content scale factor range bounds. */
|
---|
50 | #define VBOX_OGL_SCALE_FACTOR_MIN 0.01
|
---|
51 | #define VBOX_OGL_SCALE_FACTOR_MAX 10.0
|
---|
52 |
|
---|
53 | bool RTCALL VBoxOglIsOfflineRenderingAppropriate(void);
|
---|
54 | bool RTCALL VBoxOglIs3DAccelerationSupported(void);
|
---|
55 |
|
---|
56 | DECLEXPORT(int) VBoxOglSetScaleFactor(uint32_t idScreen, double dScaleFactorW, double dScaleFactorH);
|
---|
57 |
|
---|
58 | RT_C_DECLS_END
|
---|
59 |
|
---|
60 | #endif /* !VBOX_INCLUDED_VBoxOGL_h */
|
---|