]> git.saurik.com Git - wxWidgets.git/blame - utils/glcanvas/win/glcanvas.h
wxFileConfig ctor now (again) uses the files in the correct locations if the
[wxWidgets.git] / utils / glcanvas / win / glcanvas.h
CommitLineData
6a1120ad
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: glcanvas.h
3// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Windows
4// Author: Julian Smart
5// Modified by:
6// Created: 04/01/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma interface "glcanvas.h"
14#endif
15
16#ifndef _WX_GLCANVAS_H_
17#define _WX_GLCANVAS_H_
18
19#include <wx/scrolwin.h>
20
21#include "gl/gl.h"
22
23class wxGLContext: public wxObject
24{
25public:
26 wxGLContext(bool isRGB, wxWindow *win, const wxPalette& palette = wxNullPalette);
27 ~wxGLContext();
28
29 void SetCurrent();
30 void SetColour(const char *colour);
31 void SwapBuffers();
32
33 void SetupPixelFormat();
34 void SetupPalette(const wxPalette& palette);
35 wxPalette CreateDefaultPalette();
36
37 inline wxPalette* GetPalette() const { return (wxPalette*) & m_palette; }
38 inline wxWindow* GetWindow() const { return m_window; }
39 inline WXHDC GetHDC() const { return m_hDC; }
40 inline HGLRC GetGLRC() const { return m_glContext; }
41
42public:
43 HGLRC m_glContext;
44 WXHDC m_hDC;
45 wxPalette m_palette;
46 wxWindow* m_window;
47};
48
49class wxGLCanvas: public wxScrolledWindow
50{
51 DECLARE_CLASS(wxGLCanvas)
52 public:
53 wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
54 const wxSize& size = wxDefaultSize, long style = 0,
55 const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette);
56 ~wxGLCanvas();
57
58 void SetCurrent();
59 void SetColour(const char *colour);
60 void SwapBuffers();
61
62 void OnSize(wxSizeEvent& event);
63
64 void OnQueryNewPalette(wxQueryNewPaletteEvent& event);
65 void OnPaletteChanged(wxPaletteChangedEvent& event);
66
67 inline wxGLContext* GetContext() const { return m_glContext; }
68
69protected:
70 wxGLContext* m_glContext; // this is typedef-ed ptr, in fact
71
72DECLARE_EVENT_TABLE()
73};
74
75#ifdef __cplusplus
76extern "C" {
77#endif
78
79/* Give extensions proper function names. */
80
81/* N.B. - this is not completely implemented as yet */
82
83/* EXT_vertex_array */
84void glArrayElementEXT(GLint i);
85void glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
86void glDrawArraysEXT(GLenum mode, GLint first, GLsizei count);
87void glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *pointer);
88void glGetPointervEXT(GLenum pname, GLvoid* *params);
89void glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
90void glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
91void glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
92void glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
93
94/* EXT_color_subtable */
95void glColorSubtableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *table);
96
97/* EXT_color_table */
98void glColorTableEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
99void glCopyColorTableEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
100void glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *table);
101void glGetColorTableParamaterfvEXT(GLenum target, GLenum pname, GLfloat *params);
102void glGetColorTavleParameterivEXT(GLenum target, GLenum pname, GLint *params);
103
104/* SGI_compiled_vertex_array */
105void glLockArraysSGI(GLint first, GLsizei count);
106void glUnlockArraysSGI();
107
108/* SGI_cull_vertex */
109void glCullParameterdvSGI(GLenum pname, GLdouble* params);
110void glCullParameterfvSGI(GLenum pname, GLfloat* params);
111
112/* SGI_index_func */
113void glIndexFuncSGI(GLenum func, GLclampf ref);
114
115/* SGI_index_material */
116void glIndexMaterialSGI(GLenum face, GLenum mode);
117
118/* WIN_swap_hint */
119void glAddSwapHintRectWin(GLint x, GLint y, GLsizei width, GLsizei height);
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif