indexing description: "An Eiffel class wrapper to a OpenGL display list" date: "$Date$" revision: "$Revision$" class EMGL_DISPLAY_LIST inherit GL_FUNCTIONS export {NONE} all redefine default_create end EM_CONSTANTS export {NONE} all; {ANY} em_gl_compile, em_gl_compile_and_execute redefine default_create end DISPOSABLE redefine default_create end feature {NONE} -- Initialization and destruction default_create is -- Create a new EMGL_DISPLAY_LIST object. do list_id := gl_gen_lists(1) end dispose is -- free the displaylist do gl_delete_lists( list_id, 1 ) end feature {NONE} -- Access -- The list id should not be visible to the outside, or it will be messed around with... list_id: INTEGER feature -- Commands new_list( mode: INTEGER ) is -- Create a new list -- mode: em_gl_compile or em_gl_compile_and_execute require valid_mode: mode=em_gl_compile or mode=em_gl_compile_and_execute do gl_new_list(list_id, mode) end new_list_compile is -- Create a new list with the flag em_gl_compile do new_list(em_gl_compile) end new_list_compile_and_execute is -- Create a new list with the flag em_gl_compile_and_execute do new_list(em_gl_compile_and_execute) end end_list is -- End the displaylist do gl_end_list end call_list is -- Call the displaylist do gl_call_list( list_id ) end invariant valid_list_id: gl_is_list( list_id ) > 0 end -- class EMGL_DISPLAY_LIST