🔒 Locked
glPointPerameterf on Linux
Advertisement
Original Post
hello all i am writing a particle engine in C++/OpenGL and i am using point sprites (oooh clever). everythign works fine, but i can't get the attenuation (particles vary in size according to distance from camera) to work. i am using Linux, and as far as i can gather i need glext to use the extensions contained within that library. i have included it and i have linked to it from my Makefile with the flag -lglext to no avail. i have looked in /usr/include/GL and glext is there with the stuff i need in it, but i have looked in /usr/lib and there is no libglext or anything like it. maybe i should post this on a linux forum, but if youre reading this its too late :P. in short, how can i get point sprite attenuation to work on linux. thankyou to any replies, helpful, funny or just plain annoying, as there is NO documentation on this. another thing, in this closed post http://www.gamedev.net/community/forums/topic.asp?topic_id=403529 it talks about this, but there is no evidence of an extension library being used. can enyone enlighten me? all the same problem really james waples, 14
wow. thanks for the very quick reply :D
i am getting compile errors that say glPointPerameterf has not been defined here
james
i am getting compile errors that say glPointPerameterf has not been defined here
james
oh, and your define thing didnt work. sorry :P
any other ideas?
james
any other ideas?
james
You may need a newer copy of glext, and possibly a newer version of your graphics card drivers. However, I would really recommend that you avoid messing with glext entirely, and let a library such as GLEE do it for you.
looks promising :P
i have got it working, sort of. how can i use glPointParameterfv() with something that isnt a GLfloat, but a number like 2.0f or 60.0f
e.g:
float fAtten[4] = { 0.0f, 0.0f, 0.01f };
glPointParameterfv(GL_POINT_SIZE_MIN, 2.0f);
glPointParameterfv(GL_POINT_SIZE_MAX, 60.0f);
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION_ARB, fAtten);
glPointParameterfv(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 60.0f);
the errors are
japeEngine.cpp: In member function ‘void japeEmitter::drawParticles()’:
japeEngine.cpp:214: error: invalid conversion from ‘int’ to ‘const GLfloat*’
japeEngine.cpp:215: error: invalid conversion from ‘int’ to ‘const GLfloat*’
japeEngine.cpp:217: error: invalid conversion from ‘int’ to ‘const GLfloat*’
e.g:
float fAtten[4] = { 0.0f, 0.0f, 0.01f };
glPointParameterfv(GL_POINT_SIZE_MIN, 2.0f);
glPointParameterfv(GL_POINT_SIZE_MAX, 60.0f);
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION_ARB, fAtten);
glPointParameterfv(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 60.0f);
the errors are
japeEngine.cpp: In member function ‘void japeEmitter::drawParticles()’:
japeEngine.cpp:214: error: invalid conversion from ‘int’ to ‘const GLfloat*’
japeEngine.cpp:215: error: invalid conversion from ‘int’ to ‘const GLfloat*’
japeEngine.cpp:217: error: invalid conversion from ‘int’ to ‘const GLfloat*’
sorry to bother you, but i now have glee working - thankyou very very much. could yout tell me how i can change the sizes of the particles please. actually, dont because i can just search these forums and the net. thanks anyway lol
james
james
Quote:The *fv versions of the function take pointers to floats, you probably want glPointParameterf, instead.
Original post by jamwaffles
i have got it working, sort of. how can i use glPointParameterfv() with something that isnt a GLfloat, but a number like 2.0f or 60.0f
e.g:
float fAtten[4] = { 0.0f, 0.0f, 0.01f };
glPointParameterfv(GL_POINT_SIZE_MIN, 2.0f);
glPointParameterfv(GL_POINT_SIZE_MAX, 60.0f);
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION_ARB, fAtten);
glPointParameterfv(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 60.0f);
the errors are
japeEngine.cpp: In member function ‘void japeEmitter::drawParticles()’:
japeEngine.cpp:214: error: invalid conversion from ‘int’ to ‘const GLfloat*’
japeEngine.cpp:215: error: invalid conversion from ‘int’ to ‘const GLfloat*’
japeEngine.cpp:217: error: invalid conversion from ‘int’ to ‘const GLfloat*’
yeah. i managed to sort that out - GLee is working perfectly. thankyou very much for the recomendation, it has sorted everything out for me. now all i have to do is collision detection. hard. ah well, google helps. thanks again
james
james
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement