Is gluPerspective deprecated?
#1 Members - Reputation: 392
Posted 01 December 2012 - 06:08 PM
#2 Moderators - Reputation: 13518
Posted 01 December 2012 - 06:35 PM
[edit]n.b. this doesn't mean you should be using it -- it's just a wrapper around other GL functions, which may themselves be deprecated[/edit]
Edited by Hodgman, 02 December 2012 - 07:25 PM.
#4 Members - Reputation: 3809
Posted 01 December 2012 - 06:52 PM
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
#5 Members - Reputation: 392
Posted 02 December 2012 - 11:21 AM
#6 Members - Reputation: 307
Posted 02 December 2012 - 11:36 AM
#10 Members - Reputation: 3809
Posted 02 December 2012 - 01:55 PM
And what do you expect to happen when you call it, even if there is no error reported? The function operates on the current matrix stack, but there is no such thing in a core context.
Yup, this basically.
If gluPerspective works in your tests, all that means is that your GL implementation is not fully conformant in that it's allowing you to do things in a core profile that you should not be allowed to do. So the fact that it works is something you should most definitely not be relying on, because a future driver revision, or other hardware, could quite easily break it.
If you want to construct a perspective matrix there is a much easier way that will work in all cases. Just grab a sample implementation of gluPerspective from something like Mesa and re-implement it in a conformant manner. Or better yet, use a tried and trusted matrix library that will already contain a routine for constructing a perspective matrix.
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
#11 Crossbones+ - Reputation: 5155
Posted 02 December 2012 - 02:06 PM
If you are using shaders as you should be (in OpenGL 4.0, not using shaders is deprecated) then there is no way glu* can help you. The matrices you want to create will be used by you manually in your shaders.
This is actually a good thing honestly because OpenGL was originally not created for games and had some quirks in it that made it more of a nuisance than anything else (for example, lights were originally multiplied by the current model-view matrix, so you had to constantly update their positions every frame and in a very inefficient manner).
With shaders nothing is done for you. You have to write your own shaders and thus, by definition, you have to handle the primitive pipeline manually.
glu* and friends no longer have meaning because they set a bunch of states that you aren’t (shouldn’t be) using.
In OpenGL 4.0, you need to have your own matrix math library, calculate your own model, view, and projection matrices, and send them to your shaders manually.
L. Spiro
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
#12 Members - Reputation: 1086
Posted 02 December 2012 - 02:35 PM
My journal: Making a Terrain Generator






