source: trunk/src/gdi32/opengl.cpp@ 46

Last change on this file since 46 was 46, checked in by sandervl, 26 years ago

* empty log message *

File size: 2.9 KB
Line 
1/*
2 * GDI32 OpenGl stubs
3 *
4 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
5 *
6 * Project Odin Software License can be found in LICENSE.TXT
7 *
8 */
9#include <os2win.h>
10#include <stdarg.h>
11#include <string.h>
12#include "misc.h"
13#include "unicode.h"
14
15typedef int (* WIN32API CHOOSEPIXELFMT) (HDC, CONST PIXELFORMATDESCRIPTOR *);
16typedef BOOL (* WIN32API SETPIXELFMT) (HDC, int, CONST PIXELFORMATDESCRIPTOR *);
17typedef BOOL (* WIN32API SWAPBUFFERS) (HDC hdc);
18
19CHOOSEPIXELFMT glChoosePixelFormat = NULL;
20SETPIXELFMT glSetPixelFormat = NULL;
21SWAPBUFFERS glSwapBuffers = NULL;
22
23HINSTANCE hOpenGL = NULL;
24
25//******************************************************************************
26//******************************************************************************
27int WIN32API ChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR *pformat)
28{
29 int rc;
30
31 return(1);
32 dprintf(("OS2ChoosePixelFormat\n"));
33 if(hOpenGL == NULL) {
34 hOpenGL = O32_LoadLibrary("OPENGL32.DLL");
35 if(hOpenGL == NULL)
36 return(0);
37 }
38 if(glChoosePixelFormat == NULL) {
39 glChoosePixelFormat = (CHOOSEPIXELFMT)O32_GetProcAddress(hOpenGL, "OS2wglChoosePixelFormat");
40 if(glChoosePixelFormat == NULL)
41 return(0);
42 }
43 rc = glChoosePixelFormat(hdc, pformat);
44 dprintf(("wglChoosePixelFormat returned %d\n", rc));
45 return(rc);
46}
47//******************************************************************************
48//******************************************************************************
49BOOL WIN32API SetPixelFormat(HDC hdc, int whatever, CONST PIXELFORMATDESCRIPTOR * pformat)
50{
51 BOOL rc;
52
53 dprintf(("OS2SetPixelFormat\n"));
54 if(hOpenGL == NULL) {
55 hOpenGL = O32_LoadLibrary("OPENGL32.DLL");
56 if(hOpenGL == NULL)
57 return(FALSE);
58 }
59 if(glSetPixelFormat == NULL) {
60 glSetPixelFormat = (SETPIXELFMT)O32_GetProcAddress(hOpenGL, "OS2wglSetPixelFormat");
61 if(glSetPixelFormat == NULL)
62 return(FALSE);
63 }
64 rc = glSetPixelFormat(hdc, whatever, pformat);
65 dprintf(("wglSetPixelFormat returned %d\n", rc));
66 return(rc);
67}
68//******************************************************************************
69//******************************************************************************
70BOOL WIN32API SwapBuffers(HDC hdc)
71{
72 BOOL rc;
73
74 dprintf(("OS2SwapBuffers\n"));
75 if(hOpenGL == NULL) {
76 hOpenGL = O32_LoadLibrary("OPENGL32.DLL");
77 if(hOpenGL == NULL)
78 return(FALSE);
79 }
80 if(glSwapBuffers == NULL) {
81 glSwapBuffers = (SWAPBUFFERS)O32_GetProcAddress(hOpenGL, "OS2wglSwapBuffers");
82 if(glSwapBuffers == NULL)
83 return(FALSE);
84 }
85 rc = glSwapBuffers(hdc);
86 dprintf(("wglSwapBuffers returned %d\n", rc));
87 return(rc);
88}
89//******************************************************************************
90//******************************************************************************
Note: See TracBrowser for help on using the repository browser.