顯示具有 Compile Error 標籤的文章。 顯示所有文章
顯示具有 Compile Error 標籤的文章。 顯示所有文章

22 10月 2010

'GL_BGR' : undeclared identifier

During the implementation of homework #02, I think it's better to be familiar to Picture Drawing and Texture Mapping first.


When I use the GL_BGR in "glDrawPixels()", it appear this compile error from VC++.


Solution is : 
try GL_BGR_EXT if it still dosnt work, you need to download updated GLext.h files from SGI or nVidia/ATi devloper relations. 
 by Silvermace in the GameDev Forum.

Why did we need to use GLext.h???  The OpenGL Website says:

Core API and Extension Header Files
Because extensions vary from platform to platform and driver to driver, OpenGL developers can't expect interfaces for all extensions to be defined in the standard gl.hglx.h, and wgl.h header files. Additional header files - glext.h,glxext.h, and wglext.h - are provided here
Why  did we need to use BGR instead of RGB ??
Because the actual storage format of each pixel in Windows system is BGR, not RGB.
Just a debug record.
 

20 7月 2010

[VS2005] error C3861: 'exit': identifier not found

when I try to use some example codes of OpenGL, I'll sometimes get the compile error
"error C3861: 'exit': identifier not found" from the keyboard subroutine:


  • void keyboard(unsigned char key, int x, int y){
  • switch(key){
  • case 27:
  • exit(0);
  • break;
  • }
  • }

Finally, I found the solution that is to add the include information on the top of the cpp file.
#include < stdlib.h >

The original discussion thread is from Windows Forums, and solution is provided by Brian Kramer.