3 Copyright (C) 2007 Cockos Incorporated
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
32 #include "../wingui/membitmap.h"
34 class WDL_GPU_Surface
;
44 int isInited() { return m_glDll
!= NULL
; }
46 WDL_GPU_Surface
*createSurface(WDL_WinMemBitmap
*bm
, int w
, int h
);
48 HGLRC (WINAPI
*wglCreateContext
)(HDC dc
);
49 BOOL (WINAPI
*wglMakeCurrent
)(HDC dc
, HGLRC rc
);
50 BOOL (WINAPI
*wglDeleteContext
)(HGLRC rc
);
51 PROC (WINAPI
*wglGetProcAddress
)(LPCSTR name
);
53 void (WINAPI
*glClearColor
)(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
);
54 void (WINAPI
*glClear
)(GLbitfield mask
);
55 void (WINAPI
*glEnable
)(GLenum cap
);
56 void (WINAPI
*glDisable
)(GLenum cap
);
57 void (WINAPI
*glBlendFunc
)(GLenum sfactor
, GLenum dfactor
);
58 void (WINAPI
*glLineWidth
)(GLfloat width
);
59 void (WINAPI
*glColor3f
)(GLfloat red
, GLfloat green
, GLfloat blue
);
60 void (WINAPI
*glBegin
)(GLenum mode
);
61 void (WINAPI
*glEnd
)();
62 void (WINAPI
*glVertex2f
)(GLfloat x
, GLfloat y
);
63 void (WINAPI
*glFlush
)();
64 void (WINAPI
*glFinish
)();
65 const GLubyte
*(WINAPI
*glGetString
)(GLenum name
);
66 void (WINAPI
*glReadPixels
)(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
, GLvoid
*pixels
);
68 // WGL_ARB_extensions_string
69 PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB
;
72 PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB
;
73 PFNWGLGETPBUFFERDCARBPROC wglGetPbufferDCARB
;
74 PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB
;
75 PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB
;
76 PFNWGLQUERYPBUFFERARBPROC wglQueryPbufferARB
;
78 // WGL_ARB_pixel_format
79 PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB
;
80 PFNWGLGETPIXELFORMATATTRIBFVARBPROC wglGetPixelFormatAttribfvARB
;
81 PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB
;
91 WDL_GPU_Surface(WDL_GPU
*parent
, WDL_WinMemBitmap
*bm
, int w
, int h
);
94 void clear(float cr
, float cg
, float cb
);
96 void setLineAA(int on
);
97 void beginLine(float cr
, float cg
, float cb
);
99 void drawLine(int x1
, int y1
, int x2
, int y2
);
105 WDL_WinMemBitmap
*m_bm
;
106 HBITMAP m_oldbm
, m_bmp
;
109 HPBUFFERARB m_hPBuffer
;