Problems in creating a display list!

I’m having problems in creating a display list in Fortran! Am I doing something wrong?

 
indice=glGenLists(1)
write(*,*)indice	!This line returns me 0

auxl=glIsList(1)	
write(*,*)auxl		!This line returns me False

CALL glNewList(indice,GL_COMPILE)
	!Block with my draw
CALL glEndList()

auxl=glIsList(indice)
write(*,*)auxl		!This line returns me False
 

This is the first display list not just in my program, but in my life, so, why the program is returning me 0, like if there was no display list that could be created?

Thanks for the help!

I guess you have to submit the indice variable to glIsList instead of 1

I’d already done that, but it didn’t, that’s why I’ve putted 1 instead indice.

you cannot call glGenLists(…) between a call to glBegin(…) and the corresponding call to glEnd()… Perhaps you did something like that ?

some calls are not allowed between glbeginlist and glendlist you better check for those command if you have not done this yet

if glgenlists returns 0 then the call to glGenLists has failed according to the online help

you have 2 possibilities

  1. range is negative - which is not true in your case

  2. you call glGenList between glBegin and glEnd which has been noted before

so you have to check the 2nd case

Nope, none of these situations are happening! There’s no invalid call inside glNewList() and glEndList(), the rage is not negative and there’s no outer glBegin().

I’ve just used this subroutine in a small program, and it worked pretty well! The problem is somewhere else! Thanks everybody for your help!