Hello,
this is my program :
scene.h
GLunit _model_init;
/*********/
scene.cpp
Scene::Scene()
{
_model_init=0;
}
////////////
void Scene::loadModel(int id)
{
GLuint idModel;
idModel=id+1;
if (_model_init==0)
{
_model_init=glGenLists(1); // _model_init doesn't increase _model_init=0 all over the time ???
}
if (_model_init!=0) //'if' hasn't checked because _model_init value is always worth 0
{
glNewLists(idModel, GL_COMPILE);
(...);
glEndLists();
}
}
////////////
void Scene::painGL()
{
idStock=idModel;
glCallLists(idStock);
}
have you a solution for my problem, please?
thanks
Bunny
Originally posted by bunny-3110:
[b]Hello,
this is my program :
scene.h
GLunit _model_init;
/*********/
scene.cpp
Scene::Scene()
{
_model_init=0;
}
////////////
void Scene::loadModel(int id)
{
GLuint idModel;
idModel=id+1;
if (_model_init==0)
{
_model_init=glGenLists(1); // _model_init doesn’t increase _model_init=0 all over the time ???
}
if (_model_init!=0) //‘if’ hasn’t checked because _model_init value is always worth 0
{
glNewLists(idModel, GL_COMPILE);
(…);
glEndLists();
}
}
////////////
void Scene::painGL()
{
idStock=idModel;
glCallLists(idStock);
}
[/b]
_model_init=glGenLists(1); // _model_init doesn’t increase _model_init=0 all over the time ???
glNewLists(idModel, GL_COMPILE);
You should use glNewLists(_model_init, GL_COMPILE);
idModel is IMHO useless.
system
Closed
October 19, 2021, 6:46pm
3
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.