VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/ogl_hgcm.h@ 16241

Last change on this file since 16241 was 15532, checked in by vboxsync, 16 years ago

crOpenGL: export to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1/* $Id: ogl_hgcm.h 15532 2008-12-15 18:53:11Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox Windows NT/2000/XP guest OpenGL hgcm related
6 *
7 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef __VBOXOGL_HGCM_H__
23#define __VBOXOGL_HGCM_H__
24
25#include <windows.h>
26#include <iprt/cdefs.h>
27#include <iprt/assert.h>
28
29typedef struct
30{
31 HANDLE hGuestDrv;
32
33} VBOX_OGL_CTX, *PVBOX_OGL_CTX;
34
35typedef struct
36{
37 uint32_t u32ClientID;
38} VBOX_OGL_THREAD_CTX, *PVBOX_OGL_THREAD_CTX;
39
40/**
41 * Initialize the OpenGL guest-host communication channel
42 *
43 * @return success or failure (boolean)
44 */
45BOOL VBoxOGLInit();
46
47/**
48 * Destroy the OpenGL guest-host communication channel
49 *
50 * @return success or failure (boolean)
51 */
52BOOL VBoxOGLExit();
53
54/**
55 * Initialize new thread
56 *
57 * @return success or failure (boolean)
58 */
59BOOL VBoxOGLThreadAttach();
60
61/**
62 * Clean up for terminating thread
63 *
64 * @return success or failure (boolean)
65 */
66BOOL VBoxOGLThreadDetach();
67
68/**
69 * Set the thread local OpenGL context
70 *
71 * @param pCtx thread local OpenGL context ptr
72 */
73void VBoxOGLSetThreadCtx(PVBOX_OGL_THREAD_CTX pCtx);
74
75/**
76 * Return the thread local OpenGL context
77 *
78 * @return thread local OpenGL context ptr or NULL if failure
79 */
80PVBOX_OGL_THREAD_CTX VBoxOGLGetThreadCtx();
81
82#ifdef DEBUG
83#define glLogError(a) \
84 { \
85 /** @todo log error */ \
86 glSetError(a); \
87 }
88#define DbgPrintf(a) VBoxDbgLog a
89
90#ifdef VBOX_DEBUG_LVL2
91#define DbgPrintf2(a) VBoxDbgLog a
92#else
93#define DbgPrintf2(a)
94#endif
95
96#else
97#define glLogError(a) glSetError(a)
98#define DbgPrintf(a)
99#define DbgPrintf2(a)
100#endif
101
102#ifdef DEBUG
103/**
104 * Log to the debug output device
105 *
106 * @param pszFormat Format string
107 * @param ... Variable parameters
108 */
109void VBoxDbgLog(char *pszFormat, ...);
110#endif
111
112#endif /* __VBOXOGL_HGCM_H__ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette