Skip to main content
gamedev.net
🔒 Locked

glPointPerameterf on Linux

Started by jamwaffles Feb 20, 2009 at 5:26 AM 8 replies 1.3k views
Original Post
jamwaffles
jamwaffles
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
http://www.jamwaffles.co.uk - my site - new look, faster loading, free wallpapers, tutorials and other pointless crap.
HuntsMan
HuntsMan
What kind of problem are you getting? Compile error? Link errors?

You should try #defining GLEXT_PROTOTYPES before including gl.h
jamwaffles
jamwaffles
wow. thanks for the very quick reply :D

i am getting compile errors that say glPointPerameterf has not been defined here

james
http://www.jamwaffles.co.uk - my site - new look, faster loading, free wallpapers, tutorials and other pointless crap.
jamwaffles
jamwaffles
oh, and your define thing didnt work. sorry :P

any other ideas?

james
http://www.jamwaffles.co.uk - my site - new look, faster loading, free wallpapers, tutorials and other pointless crap.
swiftcoder
swiftcoder
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.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
jamwaffles
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*’
http://www.jamwaffles.co.uk - my site - new look, faster loading, free wallpapers, tutorials and other pointless crap.
jamwaffles
jamwaffles
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
http://www.jamwaffles.co.uk - my site - new look, faster loading, free wallpapers, tutorials and other pointless crap.
swiftcoder
swiftcoder
Quote:
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*’
The *fv versions of the function take pointers to floats, you probably want glPointParameterf, instead.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
jamwaffles
jamwaffles
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
http://www.jamwaffles.co.uk - my site - new look, faster loading, free wallpapers, tutorials and other pointless crap.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.