Skip to content

Commit

Permalink
Some questions for Luc
Browse files Browse the repository at this point in the history
  • Loading branch information
hudrima1 committed Dec 10, 2023
1 parent 7c03129 commit a534470
Show file tree
Hide file tree
Showing 8 changed files with 2,187 additions and 2,197 deletions.
4 changes: 2 additions & 2 deletions apps/app_demo_slproject/glfw/AppDemoMainGLFW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ static void onKeyPress(GLFWwindow* myWindow,
SL_LOG("----------------------------------------------");
SL_LOG("Loading SceneID: %d", AppDemo::sceneID);
}
else if (key == K_right && sv && AppDemo::sceneID < SID_Maximal - 1)
else if (key == K_right && sv && AppDemo::sceneID < SID_MaxNoBenchmarks - 1)
{
appDemoLoadScene(AppDemo::assetManager,
AppDemo::scene,
Expand Down Expand Up @@ -568,7 +568,7 @@ int main(int argc, char* argv[])
cmdLineArgs.push_back(SLstring(argv[i]));

// parse cmd line arguments
for (int i=1; i<cmdLineArgs.size(); ++i)
for (int i = 1; i < cmdLineArgs.size(); ++i)
{
if (cmdLineArgs[i] == "-onlyErrorLogs")
{
Expand Down
2 changes: 1 addition & 1 deletion apps/app_demo_slproject/source/AppDemoGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ void AppDemoGui::buildMenuBar(SLScene* s, SLSceneView* sv)
if (ImGui::MenuItem("Next Scene",
"Shift-Alt-Right",
nullptr,
AppDemo::sceneID < SID_Maximal - 1))
AppDemo::sceneID < SID_MaxPublicAssets - 1))
s->onLoad(am, s, sv, AppDemo::sceneID + 1);

if (ImGui::MenuItem("Previous Scene",
Expand Down
4,190 changes: 2,096 additions & 2,094 deletions apps/app_demo_slproject/source/AppDemoLoad.cpp

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions modules/sl/source/SLEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ enum SLSceneID
SID_ParticleSystem_RingOfFire,
SID_ParticleSystem_FireComplex,

SID_MaxNoBenchmarks,

SID_Benchmark1_LargeModel,
SID_Benchmark2_MassiveNodes,
SID_Benchmark3_NodeAnimations,
Expand All @@ -184,7 +186,7 @@ enum SLSceneID
SID_Benchmark8_ParticleSystemFireComplex,
SID_Benchmark9_ParticleSystemManyParticles,

SID_Maximal,
SID_MaxPublicAssets,

// These scenes are not part of the public data
SID_ErlebARBernChristoffel,
Expand All @@ -195,7 +197,9 @@ enum SLSceneID
SID_ErlebARAventicumAmphiteatre,
SID_ErlebARAventicumCigognier,
SID_ErlebARAventicumTheatre,
SID_ErlebARSutzKirchrain18
SID_ErlebARSutzKirchrain18,

SID_MaxAll
};
//-----------------------------------------------------------------------------
//! Mouse button codes
Expand Down
12 changes: 8 additions & 4 deletions modules/sl/source/gl/SLGLVertexArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ void SLGLVertexArray::generateTF(SLuint numVertices,
_vbo.bindAndEnableAttrib(divisor);
}

// ???
if (_externalVbo != nullptr)
{
_externalVbo->bindAndEnableAttrib(_externalDivisor);
Expand Down Expand Up @@ -317,7 +318,10 @@ void SLGLVertexArray::generateTF(SLuint numVertices,

glGenBuffers(1, &_idVBOIndices);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _idVBOIndices);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, tmBufSize, tmpBuf, GL_STATIC_DRAW);
glBufferData(GL_ELEMENT_ARRAY_BUFFER,
tmBufSize,
tmpBuf,
GL_STATIC_DRAW);
SLGLVertexBuffer::totalBufferCount++;
SLGLVertexBuffer::totalBufferSize += tmBufSize;
delete[] tmpBuf;
Expand Down Expand Up @@ -463,15 +467,15 @@ void SLGLVertexArray::drawArrayAs(SLGLPrimitiveType primitiveType,
GET_GL_ERROR;
}
//-----------------------------------------------------------------------------
/*!
/*! ???
*
* @param primitiveType
* @param countInstance
* @param numIndexes
* @param indexOffset
*/
void SLGLVertexArray::drawElementsInstanced(SLGLPrimitiveType primitiveType,
SLuint countInstance,
SLuint countInstance,
SLuint numIndexes,
SLuint indexOffset)
{
Expand All @@ -495,7 +499,7 @@ void SLGLVertexArray::drawElementsInstanced(SLGLPrimitiveType primitiveType,
(GLsizei)numIndexes,
_indexDataType,
(void*)(size_t)(indexOffset * (SLuint)indexTypeSize),
(GLsizei )countInstance);
(GLsizei)countInstance);
////////////////////////////////////////////////////////

GET_GL_ERROR;
Expand Down
2 changes: 1 addition & 1 deletion modules/sl/source/gl/SLGLVertexArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class SLGLVertexArray
SLuint _tfoID; //! OpenGL id of transform feedback object
SLuint _numVertices; //! NO. of vertices in array
SLGLVertexBuffer _vbo; //! Vertex buffer object for float attributes
SLGLVertexBuffer* _externalVbo; //! Vertex buffer object that has been created outside of this VAO
SLGLVertexBuffer* _externalVbo; //! Vertex buffer object that has been created outside of this VAO ??? What for?
SLuint _externalDivisor; //! VBO attrib divisor for the external VBO
SLuint _idVBOIndices; //! OpenGL id of index vbo
size_t _numIndicesElements; //! NO. of vertex indices in array for triangles, lines or points
Expand Down
Loading

0 comments on commit a534470

Please sign in to comment.