# define SG_GLU_H <OpenGL/glu.h>
# define SG_GLEXT_H <OpenGL/glext.h>
# define SG_GLUT_H <GLUT/glut.h>
+
+inline int (isnan)(double r) { return !(r <= 0 || r >= 0); }
#else
# define SG_GL_H <GL/gl.h>
# define SG_GLX_H <GL/glx.h>
#endif // SG_INCOMPLETE_FUNCTIONAL
+
+// stdint.h defines
+#if defined( _MSC_VER ) || defined(__MINGW32__) || defined(sun)
+typedef signed short int16_t;
+typedef signed int int32_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+#endif
+
#endif // _SG_COMPILER_H
void SGShadowVolume::init(SGPropertyNode *sim_rendering_options) {
shadows_enabled = true;
sim_rendering = sim_rendering_options;
- int stencilBits = 0, alphaBits = 0;
+ GLint stencilBits = 0, alphaBits = 0;
glGetIntegerv( GL_STENCIL_BITS, &stencilBits );
glGetIntegerv( GL_ALPHA_BITS, &alphaBits );
bool hasSubtractiveBlend = SGIsOpenGLExtensionSupported("GL_EXT_blend_subtract");
#include "newcloud.hxx"
#include "cloudfield.hxx"
+#if defined(__MINGW32__)
+#define isnan(x) _isnan(x)
+#endif
+
+#if defined (__FreeBSD__)
+# if __FreeBSD_version < 500000
+ extern "C" {
+ inline int isnan(double r) { return !(r <= 0 || r >= 0); }
+ }
+# endif
+#endif
+
extern SGSky *thesky;
static list_of_culledCloud inViewClouds;
glGenProgramsPtr(1,&vertex_id);
glBindProgramPtr(GL_VERTEX_PROGRAM_ARB,vertex_id);
glProgramStringPtr(GL_VERTEX_PROGRAM_ARB,GL_PROGRAM_FORMAT_ASCII_ARB,(GLsizei)strlen(vertex_src),vertex_src);
- int pos = -1;
+ GLint pos = -1;
glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB,&pos);
if(pos != -1) {
SG_LOG(SG_GL, SG_ALERT, "Shader::Shader(): vertex program error in " << name << " file\n" << get_error(vertex_src,pos));
glGenProgramsPtr(1,&fragment_id);
glBindProgramPtr(GL_FRAGMENT_PROGRAM_ARB,fragment_id);
glProgramStringPtr(GL_FRAGMENT_PROGRAM_ARB,GL_PROGRAM_FORMAT_ASCII_ARB,(GLsizei)strlen(fragment_src),fragment_src);
- int pos = -1;
+ GLint pos = -1;
glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB,&pos);
if(pos != -1) {
SG_LOG(SG_GL, SG_ALERT, "Shader::Shader(): fragment program error in " << name << " file\n" << get_error(fragment_src,pos));
glGenProgramsNVPtr(1,&fragment_id);
glBindProgramNVPtr(GL_FRAGMENT_PROGRAM_NV,fragment_id);
glLoadProgramNVPtr(GL_FRAGMENT_PROGRAM_NV,fragment_id,(GLsizei)strlen(fragment_src),(GLubyte*)fragment_src);
- int pos = -1;
+ GLint pos = -1;
glGetIntegerv(GL_PROGRAM_ERROR_POSITION_NV,&pos);
if(pos != -1) {
SG_LOG(SG_GL, SG_ALERT, "Shader::Shader(): fragment program error in " << name << " file\n" << get_error(fragment_src,pos));
*/
const char *Shader::get_glsl_error() {
- int length;
+ GLint length;
static char error[4096];
glGetInfoLogPtr(program,sizeof(error),&length,error);
return error;