Public Group

# Background Image Files

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

## Recommended Posts

I have [6] TGA files that are just not loading for some reason. If the reason happens to be within the CTargaImage engine then this issue is beyond me. Although, when calling, image.load("tree.tga") along with gen,bind,glubuild.. it will load. Assuring me that, yeah, the CTargaImage engine is working properly. But if im referencing a function to a different type of source code like Skybox.cpp and then make a call to Skybox().LoadTextures("..."); from the CGfxOpenGL.cpp it fails, or wont be read. ~confused Any advice is much appreciated.

##### Share on other sites
i dought moving from Dev to MVC++ 2008 will change anything.....

but i did anyway and am left with linker errors...

how do i link the OpenGL File Libraries in the source code?

##### Share on other sites
Quote:
 Original post by Vectormycalculusi dought moving from Dev to MVC++ 2008 will change anything.....but i did anyway and am left with linker errors...how do i link the OpenGL File Libraries in the source code?pragmalink(opengl32.dll) ?

You can't link DLL's, at least not to my knowledge. But if you mean a regular (static?) library:

I think you need to go into project options, find the linker options, and the box that lets you specify linker arguments, and add
-llib_name_here
That's an L in the front. It's been a while since I used Dev-C++, though, so I couldn't tell you exactly where it is.

##### Share on other sites
i got it to compile without error using these statments:

#pragma comment(lib, "OpenGL32.lib")
//#pragma comment(lib, "glut32.lib") // name?
#pragma comment(lib, "GlU32.lib") // same file

after it compiled it took me to the debugger mode

my exe is of white background

##### Share on other sites
Are you possibly calling Skybox.LoadTexture() before you initialize OpenGL? glBind, glGenTexture, and the rest of those gl functions won't work if it's called before you initialize OpenGL.

Other than that you probably need to post some code so we can get a better idea of what's going on.

##### Share on other sites
i had some trouble because of these files not loading, so i did a glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT) to give a black background...

All my header files are in place, but thats probbly not what u meant

I did try changing the order of the Skybox().LoadTextures() after removing part of the glClear(), but no results.

Could you be more specific?

bool CGfxOpenGL::Init(){	  Skybox().Initialize(5.0);  Skybox().LoadTextures("up.tga", "dn.tga", "ft.tga", "bk.tga", "lt.tga", "rt.tga");  m_pObj = gluNewQuadric();  glEnable(GL_DEPTH_TEST);  glEnable(GL_LIGHTING);  glEnable(GL_LIGHT0);  glEnable(GL_COLOR_MATERIAL);  // set up lighting  glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);  GLfloat white[] = { 1.0, 1.0, 1.0, 1.0 };  glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white);  glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 128);  glGenTextures(1, &m_envTexID);  glBindTexture(GL_TEXTURE_CUBE_MAP, m_envTexID);  glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);  glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);  glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);  glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);  // set the texture coordinate generation mode to reflection mapping  glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);  glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);  glTexGenf(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);    m_angle = 0.0;  m_ballAngle = 0.0;    return true;}

• 44
• 12
• 10
• 10
• 9
• ### Forum Statistics

• Total Topics
631372
• Total Posts
2999627
×