From: <axl...@us...> - 2008-12-23 23:06:38
|
Revision: 85 http://hgengine.svn.sourceforge.net/hgengine/?rev=85&view=rev Author: axlecrusher Date: 2008-12-23 22:53:08 +0000 (Tue, 23 Dec 2008) Log Message: ----------- draw triangles Modified Paths: -------------- Mercury2/src/MercuryVBO.cpp Mercury2/src/Quad.cpp Mercury2/src/X11Window.cpp Modified: Mercury2/src/MercuryVBO.cpp =================================================================== --- Mercury2/src/MercuryVBO.cpp 2008-12-23 19:35:29 UTC (rev 84) +++ Mercury2/src/MercuryVBO.cpp 2008-12-23 22:53:08 UTC (rev 85) @@ -46,7 +46,7 @@ //XXX This seems to apply texture coordinates to all active texture units glTexCoordPointer(2, GL_FLOAT, stride, BUFFER_OFFSET(sizeof(float)*3)); - glDrawRangeElements(GL_QUADS, 0, m_bufferLength[1], m_bufferLength[1], GL_UNSIGNED_SHORT, NULL); + glDrawRangeElements(GL_TRIANGLES, 0, m_bufferLength[1], m_bufferLength[1], GL_UNSIGNED_SHORT, NULL); m_lastVBOrendered = this; } Modified: Mercury2/src/Quad.cpp =================================================================== --- Mercury2/src/Quad.cpp 2008-12-23 19:35:29 UTC (rev 84) +++ Mercury2/src/Quad.cpp 2008-12-23 22:53:08 UTC (rev 85) @@ -9,7 +9,7 @@ Quad::Quad() { - AllocateIndexSpace(4); + AllocateIndexSpace(6); AllocateVertexSpace(4, sizeof(float)*5); float* buffer = (float*)Buffer(); @@ -31,7 +31,10 @@ indice[0] = 0; indice[1] = 1; indice[2] = 2; - indice[3] = 3; + + indice[3] = 2; + indice[4] = 3; + indice[5] = 0; } Quad::~Quad() Modified: Mercury2/src/X11Window.cpp =================================================================== --- Mercury2/src/X11Window.cpp 2008-12-23 19:35:29 UTC (rev 84) +++ Mercury2/src/X11Window.cpp 2008-12-23 22:53:08 UTC (rev 85) @@ -70,7 +70,9 @@ XFree(visinfo); m_window = win; - m_renderCtx = ctx; + m_renderCtx = ctx; + + glEnable(GL_CULL_FACE); } X11Window::~X11Window() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |