Jump to content
  • Advertisement

Archived

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

Erunama

Texture Mapping Error

This topic is 5877 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My first post on the boards, and I would like to thank NeHe for his wonderful OpenGL tutorials. I am currently on lesson 6, but have hit a brick wall with the code. I am using MSVC++ 4.0 (yes, an older version, but I had it around and don't want to upgrade). The errors deal specifically with the glGenTextures and glBindTexture, which MSVC says are undeclared and do not evaluate to a function. Here are the errors:
--------------------Configuration: 3d Cube Texture Map - Win32 Debug--------------------
Compiling...
texture_test.cpp
C:\Msdev\Projects\3d Cube Texture Map\texture_test.cpp(54) : error C2065: 'glGenTextures' : undeclared identifier
C:\Msdev\Projects\3d Cube Texture Map\texture_test.cpp(54) : error C2064: term does not evaluate to a function
C:\Msdev\Projects\3d Cube Texture Map\texture_test.cpp(57) : error C2065: 'glBindTexture' : undeclared identifier
C:\Msdev\Projects\3d Cube Texture Map\texture_test.cpp(57) : error C2064: term does not evaluate to a function
C:\Msdev\Projects\3d Cube Texture Map\texture_test.cpp(123) : error C2064: term does not evaluate to a function
Error executing cl.exe.
3d Cube Texture Map.exe - 5 error(s), 0 warning(s)
  
In case some of you aren't familiar with lesson 6, here is the LoadGLTextures() function:
  
int LoadGLTextures()								// Load Bitmaps And Convert To Textures

{
	int Status=FALSE;							// Status Indicator

	AUX_RGBImageRec *TextureImage[1];					// Create Storage Space For The Texture

	memset(TextureImage,0,sizeof(void *)*1);				// Set The Pointer To NULL


	// Load The Bitmap, Check For Errors, If Bitmap's Not Found Quit

	if (TextureImage[0]=LoadBMP("Data/NeHe.bmp"))
	{
		Status=TRUE;							// Set The Status To TRUE

		glGenTextures(1, &texture[0]);					// Create The Texture


		// Typical Texture Generation Using Data From The Bitmap

		glBindTexture(GL_TEXTURE_2D, texture[0]);
		// Generate The Texture

		glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);

		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);	// Linear Filtering

		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);	// Linear Filtering

	}

	if (TextureImage[0])							// If Texture Exists

	{
		if (TextureImage[0]->data)					// If Texture Image Exists

		{
			free(TextureImage[0]->data);				// Free The Texture Image Memory

		}

		free(TextureImage[0]);						// Free The Image Structure

	}
	return Status;								// Return The Status

}
  
Thanks for any help you can provide, Dan [edited by - Erunama on April 17, 2002 6:26:45 PM]

Share this post


Link to post
Share on other sites
Advertisement
Unfortunately, the answer was not that simple (if it was, I would have been pretty mad). Here's the included .h files


      
#include <windows.h> // Header File For Windows


#include <stdio.h> // Header File For Standard Input/Output


#include <gl\gl.h> // Header File For The OpenGL32 Library


#include <gl\glu.h> // Header File For The GLu32 Library


#include <gl\glaux.h> // Header File For The GLaux Library





[edited by - Erunama on April 18, 2002 10:10:30 PM]

Share this post


Link to post
Share on other sites
Yes, I am

And I am really confused by this, since it is only those two specific functions that are giving me errors, but not any other OGL functions.


[edited by - Erunama on April 19, 2002 10:44:44 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Lol, you guys are funny. Do you realise, that you''re using an older version of the opengl header files, and possibly even an older version of opengl dll files as well. Why don''t you upgrade your files and see if that solves your problem. Check in your gl.h file and see if "glGenTextures" is defined as a function in there. If it isn''t, chances are, your .h file is out of date, and requires a new one (which anyone should be able to send you, as long as your dll/libs are up to date, which they probably aren''t if the .h file doesn''t include it).

Billy - BillyB@mrsnj.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I sent an email to you containing the OpenGL Libs and Headers.

-Tim

Share this post


Link to post
Share on other sites

  • Advertisement

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!