さまざまなコンピューターでのOpenGLレンダリングで問題が発生しています。
動作:Intel HD3000 / Sandyブリッジ:ATI 6950 ATI 6970m ATI 5670m Quadro FX 2000
動作しません:Nvidiaモビリティ9600 gt Quadro FX 1800
コード行「renderLines()」が呼び出されると、「機能しない」グラフィックカードの画面には何も表示されません。「renderLines()」がないと、テストしたすべてのグラフィックカードですべてが期待どおりに機能します。
「renderSprites()」はrenderLines()と非常によく似ていますが、唯一の違いは、線ではなく画面にクワッドをレンダリングすることです。
void GraphicsEngineOGL3::update()
{
this->renderSprites();
this->renderLines(); // this is the offending line of code
SDL_GL_SwapBuffers();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
checkError();
}
void GraphicsEngineOGL3::renderLines()
{
if(lineBuffer_.empty()) // note: lineBuffer is a std::Vector<Vertex>
return;
glEnableClientState(GL_VERTEX_ARRAY); // DEPRECATED in OGL 3.1
glEnableClientState(GL_COLOR_ARRAY);
// Note: glVertexPointer is deprecated, change to glVertexAttribPointer
glVertexPointer(3, GL_FLOAT, sizeof(Vertex), &(lineBuffer_[0].x)); // DEPRECATED in OGL 3.1
glColorPointer(4, GL_BYTE, sizeof(Vertex), &(lineBuffer_[0].r));
glBindBuffer( GL_ARRAY_BUFFER, VBOs_[activeVBO_]);
glBufferData( GL_ARRAY_BUFFER, lineBuffer_.size() * sizeof(Vertex), &(lineBuffer_[0]), GL_STREAM_DRAW);
glDrawArrays( GL_LINES, 0, lineBuffer_.size()); // where 4 is the number of vertices in the quad
glBindBuffer( GL_ARRAY_BUFFER, 0); // Binding the buffer object with 0 switchs off VBO operation.
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
lineBuffer_.clear();
checkError();
}