Jump to content
  • Advertisement
Sign in to follow this  
JWColeman

OpenGL OpenGL Header inclusion problem

This topic is 3184 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

I get tons of errors whenever I try to include the GL headers to my Renderer.h file, things were working great when I only had the gl headers in the main.cpp file, but now when I try to create a generic draw function in my renderer which needs the headers it gives me a giant slew of errors which all point to the gl header files, help? This is main.cpp
#include <windows.h>											// Header File For Windows
#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
#include "NeHeGL.h"												// Header File For NeHeGL
#include "Logic.h"
This is Renderer.cpp
#include "Renderer.h"
#include <gl\gl.h>												// Header File For The OpenGL32 Library
#include <gl\glu.h>												// Header File For The GLu32 Library
void Renderer::draw(Renderable_Object * object)
{
	glLoadIdentity();
	glPushMatrix();
	glTranslatef(object->getPosition().x,object->getPosition().y,-50.0f);
	glBegin(GL_QUADS);						// Start Drawing Quads
		glVertex3f(object->getMinimum().x, object->getMinimum().y,  1.0f);	// Bottom Left Of The Texture and Quad
		glVertex3f( object->getMaximum().x, object->getMinimum().y,  1.0f);	// Bottom Right Of The Texture and Quad
		glVertex3f( object->getMaximum().x,  object->getMaximum().y,  1.0f);	// Top Right Of The Texture and Quad
		glVertex3f(object->getMinimum().x,  object->getMaximum().y,  1.0f);	// Top Left Of The Texture and Quad
	glEnd();
	glPopMatrix();
}

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!