// miscellaneous helper functions
// ------------------------------
-#ifndef wxHAS_OPENGL_ES
// call glcolor() for the colour with the given name, return false if
// colour not found
bool SetColour(const wxString& colour);
-#endif
// return true if the extension with given name is supported
//
wxGLAPI();
~wxGLAPI();
+ static void glFrustum(GLfloat left, GLfloat right, GLfloat bottom,
+ GLfloat top, GLfloat zNear, GLfloat zFar);
static void glBegin(GLenum mode);
static void glTexCoord2f(GLfloat s, GLfloat t);
static void glVertex3f(GLfloat x, GLfloat y, GLfloat z);
return context.SetCurrent(*static_cast<const wxGLCanvas *>(this));
}
-#ifndef wxHAS_OPENGL_ES
bool wxGLCanvasBase::SetColour(const wxString& colour)
{
wxColour col = wxTheColourDatabase->Find(colour);
if ( !col.Ok() )
return false;
+#ifdef wxHAS_OPENGL_ES
+ wxGLAPI::glColor3f(col.Red() / 256., col.Green() / 256., col.Blue() / 256.);
+#else
GLboolean isRGBA;
glGetBooleanv(GL_RGBA_MODE, &isRGBA);
if ( isRGBA )
glIndexi(pix);
}
-
+#endif
return true;
}
-#endif
wxGLCanvasBase::~wxGLCanvasBase()
{
{
}
+void wxGLAPI::glFrustum(GLfloat left, GLfloat right, GLfloat bottom,
+ GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+#if wxUSE_OPENGL_EMULATION
+ ::glFrustumf(left, right, bottom, top, zNear, zFar);
+#else
+ ::glFrustum(left, right, bottom, top, zNear, zFar);
+#endif
+}
+
+
void wxGLAPI::glBegin(GLenum mode)
{
#if wxUSE_OPENGL_EMULATION