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

Last change on this file since 97 was 97, checked in by phaller, 26 years ago

Add: added cvs variable $Id$ to source files.

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