Jump to content
  • Advertisement

Kurt Blanken

  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About Kurt Blanken

  • Rank
  1. Kurt Blanken

    Textures will not draw

    Thank you so much. That was it.
  2. Kurt Blanken

    Textures will not draw

    Which line is the very first time it reports an error? [/quote] As far as I can tell it has that value when it enters main, and stays that way until it calls resize for the first time. If it is possible that something wrong somewhere else (glut calls, linking, etc) could cause textures to not work but still be able to draw polygons, I can show the rest of the code as well.
  3. Kurt Blanken

    Textures will not draw

    You think, or you know? [/quote] After some debugging I am back to "no clue." glGetError returns 1282 all over the place.
  4. Kurt Blanken

    Textures will not draw

    I think loading the texture is not the problem. I have changed it back to GL_RGB. I am getting error number 1282 after the call to glEnd()
  5. Kurt Blanken

    Textures will not draw

    That did not fix it.
  6. SOLVED I've been following several tutorials on OpenGL and I cannot for the life of me get the texture to show up. can someone let me know what I'm doing wrong? Edit for more clarity: I get a white box. So I can see the quad, but not the texture that should be on top of it. I am using Visual Studio 2010 for compilation and freeGLUT for handling the windowing API. Edit: glGetError returns 1282 from the start of main until the first call in the resize function. My load texture function: char* fileName = "..\\Assets\\ARG.bmp"; GLubyte *TextureImage[1]; memset(TextureImage,0,sizeof(void *)*1); TextureImage[0] = LoadDIBitmap(fileName, &BitmapInfo); glEnable( GL_TEXTURE_2D ); glClearColor(0.0f, 0.0f, 0.0f, 0.5f); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glGenTextures(1, &textures[0]); glBindTexture(GL_TEXTURE_2D, textures[0]); glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, BitmapInfo->bmiHeader.biWidth, BitmapInfo->bmiHeader.biHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, TextureImage[0]); My display function: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslatef(0.0f,0.0f,-5.0f); glEnable (GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, textures[0]); glBegin (GL_QUADS); glTexCoord2d(0.0,0.0); glVertex2d(-1.0,-1.0); glTexCoord2d(1.0,0.0); glVertex2d(+1.0,-1.0); glTexCoord2d(1.0,1.0); glVertex2d(+1.0,+1.0); glTexCoord2d(0.0,1.0); glVertex2d(-1.0,+1.0); glEnd(); //glDisable (GL_TEXTURE_2D); glutSwapBuffers();
  7. Kurt Blanken

    A decent OpenGL2D Tutorial

    The problem is that I am not familiar with OpenGL. What I have to do: Welcome to OpenGL -> a bunch of stuff -> how to do 2D for someone familiar with OpenGL What I want to do: Welcome to OpenGL -> 2D in OpenGL DarklyDreaming: That is a start, but it is only code with no description as to what everything does. (Also: 2002)
  8. Kurt Blanken

    A decent OpenGL2D Tutorial

    Hello GameDev.net! I hope we become best friends in the coming months! I want to create a video game. I am developing in Visual Studio 2010 (C++). I want the project to one day be portable. Because of this, I would like to use OpenGL for my graphics. The problem is that no tutorial I have found decently explains how to do 2D in OpenGL for a beginner. I am not interested in 3D, just 2D. Can anyone link me to a decent tutorial that also was made relatively recently?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!