• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

NewDeal

Display lists suck

4 posts in this topic

Hey, Im having some problems getting my display lists working. The problem lies in the call to glGenList() i think. At least the msg box pops up when i run the function CreateDisplayList()
    
class MS3DModel
{
private:
	
	Mesh *MeshList;
	Material *MaterialList;
	int numVertices, numMeshes, numNormals, numTriangles, numMaterials;
public:
	GLuint listthingy;

	MS3DModel();
	MS3DModel(char *filename);
	~MS3DModel();
	bool LoadFromFile(char *filename);
	void Print(); // for debugging

	void Render();
	void CreateDisplayList();
	void RenderFromDisplayList();
};

void MS3DModel::CreateDisplayList()
{
	listthingy = glGenLists(1);

	if (listthingy == 0) 
	{
		MessageBox(NULL,"FUCK!!","ERROR",MB_OK|MB_ICONEXCLAMATION);
	}

	glNewList(listthingy, GL_COMPILE);
	glBegin(GL_TRIANGLE_STRIP);
	for (int m=0; m<numMeshes; m++)
	{
		
		for (int t=0; t<numTriangles; t++)
		{
			glTexCoord2f(MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[0]].u, 
MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[0]].v);
			glVertex3f(MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[0]].location[0] , 
					   MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[0]].location[1],  
					   MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[0]].location[2]);
			
			glTexCoord2f(MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[1]].u, 
MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[1]].v);
			glVertex3f(MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[1]].location[0] , 
					   MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[1]].location[1],  
					   MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[1]].location[2]);
			
			glTexCoord2f(MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[2]].u, 
MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[2]].v);
			glVertex3f(MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[2]].location[0] , 
			     	   MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[2]].location[1],  
					   MeshList[m].VerticesList[MeshList[m].TrianglesList[t].VertexIndices[2]].location[2]);

		}
		
	}
	glEnd();
	glEndList();
}
    
I got another function called Render() which has pretty much the same code as CreateDisplayList() except the list commands ofcourse, and that function works like a charm. BTW glGenLists() return 0 if an error occurs. Can figure out what goes wrong though. Hope you can help me out. Thanks in advance Edited by - newdeal on July 12, 2001 7:17:14 PM
0

Share this post


Link to post
Share on other sites
Well, just found this in some developers journal. Too bad i have no clue what the guy''s saying . Maybe you do.

quote:

"Well, that certainly sucked. Just spent the last two days tracking down why glGenLists() kept returning 0 and all display lists weren''t working. I came to the conclusion that it had to do with GL context init - the ortho views share the same display lists as the perspective view, but they are created before the context is initialized. Theoretically, it was Qt''s fault. I''ve got to organize the GL stuff, though."

0

Share this post


Link to post
Share on other sites
The first place to look is glGetError(). If the return value of glGetError() == GL_NO_ERROR, then you''re really going to have fun . There are only a few errors defined in OpenGL, and some of them, such as GL_STACK_OVERFLOW, have no effect on the program other than to set the error flag. Check out the Blue Book for a complete list of the error defines (or gl.h).
0

Share this post


Link to post
Share on other sites
There are 2 things that I would make sure of. First make sure that you are generating your lists AFTER you initialize OpenGL. And make sure that you are not calling glBegin before generating the display list. Either of those situations would cause glGenLists to fail and return GL_INVALID_OPERATION from glGetError.

Seeya
Krippy
0

Share this post


Link to post
Share on other sites
Problem solved! I was creating the lists before OpenGL was properly initialized.

Thanks guys
0

Share this post


Link to post
Share on other sites