VBoxOGL.h revision 66cb510642921add88e1f7182b92cca2cff0d21f
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* $Id$ */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** @file
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * VBox 3D Support API
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Copyright (C) 2012-2015 Oracle Corporation
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * available from http://www.virtualbox.org. This file is free software;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * General Public License (GPL) as published by the Free Software
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * The contents of this file may alternatively be used under the terms
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * of the Common Development and Distribution License Version 1.0
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * VirtualBox OSE distribution, in which case the provisions of the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * CDDL are applicable instead of those of the GPL.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync *
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * You may elect to license modified versions of this file under the
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * terms and conditions of either the GPL or the CDDL or both.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync */
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync#ifndef ___VBoxOGL_h
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync#define ___VBoxOGL_h
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync#include <iprt/cdefs.h>
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync#include <iprt/types.h>
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncRT_C_DECLS_BEGIN
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* GUI and VBox OpenGL code require scaling factor value to be stored in container
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * of type of 'double'. Communication between them is done via Main. In the same time,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * currently, Main does not like type of 'double' to be used for an interface method parameter.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * An integer type should be used instead. This value is used in order to specify scaling factor in type
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * of 'integer' units. It is assumed that GUI feeds Main with its internal scaling factor value
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * (which is originally of type of 'double') multiplied by this constant and converted resulting
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * value to type of 'uint32_t'. Then Main provides this data to OpenGL HGCM thread. Finally, VBox OpenGL
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * code divides received scalar by this constant and converts result to type of 'double'.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * This constant can be increased (multiplied by 10^n) in order to get better precision
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * for scaling factor manipulations. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define VBOX_OGL_SCALE_FACTOR_MULTIPLIER 100.0
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncbool RTCALL VBoxOglIsOfflineRenderingAppropriate(void);
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncbool RTCALL VBoxOglIs3DAccelerationSupported(void);
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncDECLEXPORT(int) VBoxOglSetScaleFactor(uint32_t idScreen, double dScaleFactorW, double dScaleFactorH);
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncRT_C_DECLS_END
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#endif /* !___VBoxOGL_h */