]>
git.saurik.com Git - wxWidgets.git/blob - utils/glcanvas/win/glcanvas.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGLCanvas, for using OpenGL with wxWindows under Windows
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma interface "glcanvas.h"
16 #ifndef _WX_GLCANVAS_H_
17 #define _WX_GLCANVAS_H_
19 #include <wx/scrolwin.h>
23 class wxGLContext
: public wxObject
26 wxGLContext(bool isRGB
, wxWindow
*win
, const wxPalette
& palette
= wxNullPalette
);
30 void SetColour(const char *colour
);
33 void SetupPixelFormat();
34 void SetupPalette(const wxPalette
& palette
);
35 wxPalette
CreateDefaultPalette();
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
; }
49 class wxGLCanvas
: public wxScrolledWindow
51 DECLARE_CLASS(wxGLCanvas
)
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
);
59 void SetColour(const char *colour
);
62 void OnSize(wxSizeEvent
& event
);
64 void OnQueryNewPalette(wxQueryNewPaletteEvent
& event
);
65 void OnPaletteChanged(wxPaletteChangedEvent
& event
);
67 inline wxGLContext
* GetContext() const { return m_glContext
; }
70 wxGLContext
* m_glContext
; // this is typedef-ed ptr, in fact
79 /* Give extensions proper function names. */
81 /* N.B. - this is not completely implemented as yet */
83 /* EXT_vertex_array */
84 void glArrayElementEXT(GLint i
);
85 void glColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
, GLsizei count
, const GLvoid
*pointer
);
86 void glDrawArraysEXT(GLenum mode
, GLint first
, GLsizei count
);
87 void glEdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*pointer
);
88 void glGetPointervEXT(GLenum pname
, GLvoid
* *params
);
89 void glIndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
, const GLvoid
*pointer
);
90 void glNormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
, const GLvoid
*pointer
);
91 void glTexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
, GLsizei count
, const GLvoid
*pointer
);
92 void glVertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
, GLsizei count
, const GLvoid
*pointer
);
94 /* EXT_color_subtable */
95 void glColorSubtableEXT(GLenum target
, GLsizei start
, GLsizei count
, GLenum format
, GLenum type
, const GLvoid
*table
);
98 void glColorTableEXT(GLenum target
, GLenum internalformat
, GLsizei width
, GLenum format
, GLenum type
, const GLvoid
*table
);
99 void glCopyColorTableEXT(GLenum target
, GLenum internalformat
, GLint x
, GLint y
, GLsizei width
);
100 void glGetColorTableEXT(GLenum target
, GLenum format
, GLenum type
, GLvoid
*table
);
101 void glGetColorTableParamaterfvEXT(GLenum target
, GLenum pname
, GLfloat
*params
);
102 void glGetColorTavleParameterivEXT(GLenum target
, GLenum pname
, GLint
*params
);
104 /* SGI_compiled_vertex_array */
105 void glLockArraysSGI(GLint first
, GLsizei count
);
106 void glUnlockArraysSGI();
108 /* SGI_cull_vertex */
109 void glCullParameterdvSGI(GLenum pname
, GLdouble
* params
);
110 void glCullParameterfvSGI(GLenum pname
, GLfloat
* params
);
113 void glIndexFuncSGI(GLenum func
, GLclampf ref
);
115 /* SGI_index_material */
116 void glIndexMaterialSGI(GLenum face
, GLenum mode
);
119 void glAddSwapHintRectWin(GLint x
, GLint y
, GLsizei width
, GLsizei height
);