- Timestamp:
- Jul 2, 2007 2:29:57 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 22545
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/test/Makefile.kmk
r3339 r3352 33 33 tstShOpenGL_DEFS = VBOX_HGCM 34 34 tstShOpenGL_SOURCES = tstShOpenGL.cpp 35 tstShOpenGL_LIBS = $(PATH_ LIB)/VBoxOGL.lib35 tstShOpenGL_LIBS = $(PATH_SDK_W2K3DDKX86_LIB)/opengl32.lib 36 36 37 37 … … 39 39 tstOGLSample_DEFS = 40 40 tstOGLSample_SOURCES = tstOGLSample.cpp 41 tstOGLSample_LIBS = $(PATH_ LIB)/VBoxOGL.lib41 tstOGLSample_LIBS = $(PATH_SDK_W2K3DDKX86_LIB)/opengl32.lib 42 42 43 tstOGLSample_LIBS.win = \44 $(PATH_LIB)/VBoxOGL.lib45 43 ### $(PATH_SDK_W2K3DDKX86_LIB)/opengl32.lib 46 44 -
trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/test/tstShOpenGL.cpp
r3339 r3352 22 22 #include <stdio.h> 23 23 24 25 26 27 // Enable OpenGL 28 29 void EnableOpenGL(HWND hWnd, HDC * hDC, HGLRC * hRC) 30 { 31 PIXELFORMATDESCRIPTOR pfd; 32 int format; 33 34 // get the device context (DC) 35 *hDC = GetDC( hWnd ); 36 37 // set the pixel format for the DC 38 ZeroMemory( &pfd, sizeof( pfd ) ); 39 pfd.nSize = sizeof( pfd ); 40 pfd.nVersion = 1; 41 pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; 42 pfd.iPixelType = PFD_TYPE_RGBA; 43 pfd.cColorBits = 24; 44 pfd.cDepthBits = 16; 45 pfd.iLayerType = PFD_MAIN_PLANE; 46 format = ChoosePixelFormat( *hDC, &pfd ); 47 SetPixelFormat( *hDC, format, &pfd ); 48 49 // create and enable the render context (RC) 50 *hRC = wglCreateContext( *hDC ); 51 wglMakeCurrent( *hDC, *hRC ); 52 53 } 54 55 // Disable OpenGL 56 57 void DisableOpenGL(HWND hWnd, HDC hDC, HGLRC hRC) 58 { 59 wglMakeCurrent( NULL, NULL ); 60 wglDeleteContext( hRC ); 61 ReleaseDC( hWnd, hDC ); 62 } 63 24 64 int main(int argc, char **argv) 25 65 { 66 HDC hdc; 67 HGLRC hglrc; 68 69 EnableOpenGL(0, &hdc, &hglrc); 70 26 71 printf("GL_VENDOR %s\n", glGetString(GL_VENDOR)); 27 72 printf("GL_RENDERER %s\n", glGetString(GL_RENDERER)); … … 29 74 printf("GL_EXTENSIONS %s\n", glGetString(GL_EXTENSIONS)); 30 75 31 glEnable(GL_BLEND); 32 glFlush(); 76 DisableOpenGL(0, hdc, hglrc); 33 77 return 0; 34 78 } 35
Note:
See TracChangeset
for help on using the changeset viewer.