Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About MystikIce

  • Rank
  1. My application is locking up when it hits this chunk of code. Can't seem to notice why though. Maybe I am overlooking something. TCHAR* lpCurDir; unsigned int bufSize, sizeofDir = 260; lpCurDir = new TCHAR[sizeofDir]; bufSize = GetCurrentDirectory(sizeofDir, lpCurDir); It stalls at exactly that line of code. Can anyone see anything out of the ordinary with it? Thanx in advance!
  2. Anyone have any idea on how to implement a working example of volumetric fog? I have a simple QUAD 100x100. I can get normal fog working on it, but that seems to keep it at y = 0 level. How can i used the EXT_fog_coord extension to have the fog rise to y = 5 level (eye level in my sample). I loaded the extension properly, and also used glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); In what way do I pass the single argument to the extension to make the fog higher? Thanx in advance!
  3. Could anyone venture a hint as to how one could use fog with a random height. For example I have my camera at position 0, 5, 0. How could I make the fog height 5 to seem as though it is at eye level? Thanx in advance!
  4. I am trying to load a bitmap for texture mapping in OpenGL. This is my first time trying it out, so I am sure I am doing something wrong. Here is the code for loading the bitmap info: char* GLIMG::loadBmp(const char *fileName) { FILE *filePtr; BITMAPFILEHEADER bHeader; BITMAPINFOHEADER bInfoHeader; if(!fileName) return NULL; if(!(filePtr = fopen(fileName, "rb"))) return NULL; fread(&bHeader, sizeof(BITMAPFILEHEADER), 1, filePtr); fread(&bInfoHeader, sizeof(BITMAPINFOHEADER), 1, filePtr); if(bInfoHeader.biBitCount < 24) return NULL; DWORD imageSize = bHeader.bfSize - bHeader.bfOffBits; pImageData = new char[imageSize]; if(pImageData){ fread(pImageData, sizeof(char), imageSize, filePtr); fclose(filePtr); return pImageData; } return NULL; } If anyone could show me where I went wrong, i'd appreciate it. Thanx in advance!
  5. MystikIce

    Starting OpenGL

    Bbalstrzmj90, That is an excellent book. That is the book that got me started with OpenGL. Buy the latest edition which is the 2nd. It's really easy to follow and the code is thoroughly commented. Happy coding.
  6. What would be the proper way to texture map? The following code segment is what I have. glGenTextures(1, &sandTexture); HANDLE hImage = LoadImage(NULL, fileName, IMAGE_BITMAP, NULL, NULL, LR_LOADFROMFILE); //Where fileName is full path to file.. glBindTexture(GL_TEXTURE_2D, sandTexture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 128, 128, 0, GL_RGB, GL_BITMAP, hSandTexture); glBegin(GL_QUADS); glTexCoord2d(0.0, 0.0); glVertex3f(-5.0f, 0.0f, -5.0f); glTexCoord2d(1.0, 0.0); glVertex3f(-5.0f, 0.0f, 5.0f); glTexCoord2d(1.0, 1.0); glVertex3f(5.0f, 0.0f, 5.0f); glTexCoord2d(0.0, 1.0); glVertex3f(5.0f, 0.0f, -5.0f); glEnd(); hSandTexture is valid handle, so I am assuming the image correctly loads. If anyone can assist please do, thanx in advance!
  7. Hello, I am having an linking error. File b.cpp has my window procedure LRESULT CALLBACK wndProc(params here) { } file a.cpp has my winmain function, I defined the wndProc prototype as 'extern LRESULT CALLBACK wndProc(params here);' However I still get a linkage error. Could someone assist in explaining the proper way to link them? Thank You.
  8. MystikIce

    Weird #if/#endif error...

    Yes it is, here is the last bulk of code. #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */ #if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0) #include "winuser.inl" #endif /* ISOLATION_AWARE_ENABLED */ #endif /* RC */ #ifdef __cplusplus #endif /* __cplusplus */ #endif /* !_WINUSER_ */
  9. Perhaps someone can help me with this problem. I was compiling my code, which compiled fine. It had a run time error because of an invalid pointer. When I closed down the project and came back to it later, I got the following error when I tried to compile (without modifying any code whatsoever). fatal error C1070: mismatched #if/#endif pair in file '(include dir here)\winuser.h' line 11832... This line is the last line in the winuser.h header file. I have no idea why this happens but it gives me the same error three times. (I have 3 .cpp files in the project, I am assuming 1 error for every file) If anyone can assist, please do. Thank You.
  • 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!