Fix missing extension checks, add access to driver (for error testing) to initExtensions. Unify setup with OpenGL driver.

git-svn-id: http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@2369 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
hybrid 2009-05-06 19:33:53 +00:00
parent a569cd5d64
commit 246878f6aa
3 changed files with 18 additions and 10 deletions

View File

@ -213,7 +213,7 @@ bool COGLES1Driver::genericDriverInit(const core::dimension2d<u32>& screenSize,
for (i=0; i<MATERIAL_MAX_TEXTURES; ++i)
CurrentTexture[i]=0;
// load extensions
initExtensions(
initExtensions(this,
#if defined(EGL_VERSION_1_0)
EglDisplay,
#endif
@ -1502,6 +1502,7 @@ bool COGLES1Driver::testGLError()
case GL_OUT_OF_MEMORY:
os::Printer::log("GL_OUT_OF_MEMORY", ELL_ERROR); break;
};
// _IRR_DEBUG_BREAK_IF(true);
return true;
#else
return false;
@ -1559,6 +1560,7 @@ void COGLES1Driver::setRenderStates3DMode()
{
// Reset Texture Stages
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR);
// switch back the matrices
@ -1931,7 +1933,7 @@ void COGLES1Driver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh
if (static_cast<u32>(LastMaterial.MaterialType) < MaterialRenderers.size())
MaterialRenderers[LastMaterial.MaterialType].Renderer->OnUnsetMaterial();
SMaterial mat;
mat.ZBuffer=0;
mat.ZBuffer=ECFN_NEVER;
mat.Lighting=false;
mat.TextureLayer[0].BilinearFilter=false;
setBasicRenderStates(mat, mat, true);

View File

@ -8,6 +8,7 @@
#ifdef _IRR_COMPILE_WITH_OGLES1_
#include "COGLESExtensionHandler.h"
#include "COGLESDriver.h"
#include "fast_atof.h"
#include "irrString.h"
@ -91,7 +92,7 @@ void COGLES1ExtensionHandler::dump() const
}
void COGLES1ExtensionHandler::initExtensions(
void COGLES1ExtensionHandler::initExtensions(COGLES1Driver* driver,
#ifdef EGL_VERSION_1_0
EGLDisplay display,
#endif
@ -150,11 +151,17 @@ void COGLES1ExtensionHandler::initExtensions(
glGetIntegerv(GL_MAX_LIGHTS, &val);
MaxLights = static_cast<u8>(val);
#ifdef GL_EXT_texture_filter_anisotropic
glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &val);
MaxAnisotropy = static_cast<u8>(val);
if (FeatureAvailable[GL_EXT_texture_filter_anisotropic])
{
glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &val);
MaxAnisotropy = static_cast<u8>(val);
}
#endif
glGetIntegerv(GL_MAX_CLIP_PLANES, &val);
MaxUserClipPlanes = static_cast<u8>(val);
if (FeatureAvailable[IRR_IMG_user_clip_planes])
{
glGetIntegerv(GL_MAX_CLIP_PLANES, &val);
MaxUserClipPlanes = static_cast<u8>(val);
}
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
if (FeatureAvailable[IRR_OES_draw_texture])
@ -179,7 +186,6 @@ void COGLES1ExtensionHandler::initExtensions(
pGlGenerateMipMapOES = (PFNGLGENERATEMIPMAPOES) eglGetProcAddress("glGenerateMipMapOES");
}
#endif
}
} // end namespace video

View File

@ -29,7 +29,7 @@ namespace irr
{
namespace video
{
class COGLES1Driver;
class COGLES1ExtensionHandler
{
protected:
@ -108,7 +108,7 @@ namespace video
void dump() const;
void initExtensions(
void initExtensions(COGLES1Driver* driver,
#ifdef EGL_VERSION_1_0
EGLDisplay display,
#endif