Posted: Fri Mar 06, 2009 3:25 am
Interesting... GL_EXT_texture_filter_anisotropic is defined without it having the extension.
Official forum of the Irrlicht Engine
https://irrlicht.sourceforge.io/forum/
Code: Select all
//! sets the needed renderstates
void COGLES1Driver::setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel)
{
...
m.buildProjectionMatrixOrthoLH(f32(renderTargetSize.Width), f32(-renderTargetSize.Height), -1.0, 1.0);
...
}
Code: Select all
m.buildProjectionMatrixOrthoLH(f32(renderTargetSize.Width), f32(-(s32)(renderTargetSize.Height)), -1.0, 1.0);
Code: Select all
//! Draws a 3d line.
void COGLES1Driver::draw3DLine(const vector3df& start,
const vector3df& end, SColor color)
{
setRenderStates3DMode();
u16 indices[] = {0,1};
S3DVertex vertices[2];
vertices[0] = S3DVertex(start.X,start.Y,start.Z, 0,0,1, color, 0,0);
vertices[1] = S3DVertex(end.X,end.Y,end.Z, 0,0,1, color, 0,0);
#if 0
drawVertexPrimitiveList2d3d(vertices, 2, indices, 1, EVT_STANDARD, EPT_LINES, EIT_16BIT, false);
#else
drawVertexPrimitiveList2d3d(vertices, 2, indices, 1, EVT_STANDARD, EPT_LINES, EIT_16BIT, true);
#endif
}
3. 09. Mashviewer
- Wire overlay is not working ( change whole object to grey colour without wire effect )
6. 12.TerrainRendering
- wire frame is not showing as 09. Mashviewer problem.
Code: Select all
//note that PolygonMode in OpenGL ES is not directly supported. The following provides
//a workaround for PolygonMode(GL_LINES) or PolygonMode(GL_POINTS). However, the wireframe
//mode, which corresponds to GL_LINES, is inefficiently emulated because a large number
//of function calls are needed.
//
//QUAD_STRIP, QUADS and POLYGON are also not directly supported. We use triangle strips,
//triangle loops to render them.
#if 1
case EPT_TRIANGLE_STRIP:
if(Material.Wireframe)
{
for(s32 i = 0; i<primitiveCount; i++)
glDrawElements(GL_LINE_LOOP, 3, GL_UNSIGNED_SHORT, (u16 *)indexList+i);
}
else
glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLE_STRIP, primitiveCount+2, GL_UNSIGNED_SHORT, indexList);
break;
case EPT_TRIANGLE_FAN:
if(Material.Wireframe)
{
//draw the outer line loop
glDrawElements(GL_LINE_LOOP, primitiveCount, GL_UNSIGNED_SHORT, indexList);
//draw inner lines
u16 lineIndex[2];
lineIndex[0] = *((u16 *)indexList);
for(s32 i = 2; i <= primitiveCount; i++)
{
lineIndex[1] = *((u16 *)indexList + i);
glDrawElements(GL_LINES, 2, GL_UNSIGNED_SHORT, lineIndex);
}
}
glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLE_FAN, primitiveCount+2, GL_UNSIGNED_SHORT, indexList);
break;
case EPT_TRIANGLES:
if(Material.Wireframe)
{
for(s32 i = 0; i < primitiveCount; i++)
glDrawElements(GL_LINE_LOOP, 3, GL_UNSIGNED_SHORT, (u16 *)indexList+(i*3));
}
else
glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLES, primitiveCount*3, GL_UNSIGNED_SHORT, indexList);
break;
case EPT_QUAD_STRIP:
if(Material.Wireframe)
{
u16 lineIndex[4];
for(s32 i = 0; i < primitiveCount; i++)
{
lineIndex[0] = *((u16 *)indexList + (i*2));
lineIndex[1] = *((u16 *)indexList + (i*2+1));
lineIndex[2] = *((u16 *)indexList + (i*2+3));
lineIndex[3] = *((u16 *)indexList + (i*2+2));
glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_SHORT, lineIndex);
}
}
else
glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLE_STRIP, primitiveCount*2+2, GL_UNSIGNED_SHORT, indexList);
break;
case EPT_QUADS:
if(Material.Wireframe)
{
for(s32 i = 0; i < primitiveCount; i++)
glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_SHORT, (u16 *)indexList+(i*4));
}
else if(Material.PointCloud)
glDrawElements(GL_POINTS, primitiveCount*4, GL_UNSIGNED_SHORT, indexList);
else
{
for(s32 i = 0; i < primitiveCount; i++)
glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, (u16 *)indexList+(i*4));
}
break;
case EPT_POLYGON:
if(Material.Wireframe)
{
for(s32 i = 0; i < primitiveCount; i++)
glDrawElements(GL_LINE_LOOP, primitiveCount, GL_UNSIGNED_SHORT, indexList);
}
else
glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLE_FAN, primitiveCount, GL_UNSIGNED_SHORT, indexList);
break;
#else
case EPT_TRIANGLE_STRIP:
glDrawElements(GL_TRIANGLE_STRIP, primitiveCount+2, GL_UNSIGNED_SHORT, indexList);
break;
case EPT_TRIANGLE_FAN:
glDrawElements(GL_TRIANGLE_FAN, primitiveCount+2, GL_UNSIGNED_SHORT, indexList);
break;
case EPT_TRIANGLES:
glDrawElements(GL_TRIANGLES, primitiveCount*3, GL_UNSIGNED_SHORT, indexList);
break;
case EPT_QUAD_STRIP:
// TODO ogl-es
// glDrawElements(GL_QUAD_STRIP, primitiveCount*2+2, indexSize, indexList);
break;
case EPT_QUADS:
// TODO ogl-es
// glDrawElements(GL_QUADS, primitiveCount*4, indexSize, indexList);
break;
case EPT_POLYGON:
// TODO ogl-es
// glDrawElements(GL_POLYGON, primitiveCount, indexSize, indexList);
break;
#endif
Loaded texture: /root/irrlicht-ogl-es-basis/media/2ddemo.bmp
GL_INVALID_VALUE
Could not glTexImage2D
GL_INVALID_VALUE
Could not glTexImage2D
Code: Select all
void* source = Image->lock();
if (newTexture)
glTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, Image->getDimension().Width,
Image->getDimension().Height, 0, PixelFormat, PixelType, source);
else
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, Image->getDimension().Width,
Image->getDimension().Height, PixelFormat, PixelType, source);
Image->unlock();
if (Driver->testGLError())
os::Printer::log("Could not glTexImage2D", ELL_ERROR);