X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e7ee4873d5b7320dd581477fa2bd7b2dc7a52030..133506215101bd8cffbf81e6c36944f7d5e2f8db:/src/common/glcmn.cpp diff --git a/src/common/glcmn.cpp b/src/common/glcmn.cpp index e52e4173e8..bcefc2c8fa 100644 --- a/src/common/glcmn.cpp +++ b/src/common/glcmn.cpp @@ -63,18 +63,22 @@ bool wxGLCanvasBase::SetCurrent(const wxGLContext& context) const return context.SetCurrent(*static_cast(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((GLfloat) (col.Red() / 256.), (GLfloat) (col.Green() / 256.), + (GLfloat) (col.Blue() / 256.)); +#else GLboolean isRGBA; glGetBooleanv(GL_RGBA_MODE, &isRGBA); if ( isRGBA ) { - glColor3f(col.Red() / 256., col.Green() / 256., col.Blue() / 256.); + glColor3f((GLfloat) (col.Red() / 256.), (GLfloat) (col.Green() / 256.), + (GLfloat) (col.Blue() / 256.)); } else // indexed colour { @@ -87,10 +91,9 @@ bool wxGLCanvasBase::SetColour(const wxString& colour) glIndexi(pix); } - +#endif return true; } -#endif wxGLCanvasBase::~wxGLCanvasBase() { @@ -206,6 +209,16 @@ wxGLAPI::~wxGLAPI() { } +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