-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera and matrix transforms don't seem to mix intuitively #26
Comments
GPU_GetProjection() returns a pointer to the current projection matrix. If SDL_gpu changes that matrix, it'll affect your pointer. If you really want to store the matrix for later, copy it into your own 16-element float array. GPU_MatrixCopy() will help. To restore it, you can copy it back onto the result of GPU_GetProjection(). GPU_MatrixCopy() is a more generic equivalent to glLoadMatrix(). You might also look at GPU_LoadIdentity() and GPU_MultMatrix(). Most of the time, however, you are temporarily changing the matrix and want to reset it back to how it was before. It might be cleaner and clearer if you use GPU_PushMatrix() to store the matrix, then GPU_PopMatrix() to restore it. It works very similarly to glPushMatrix() and glPopMatrix(). |
thanks , im asking because i have a problem mixing sdl_gpu camera with GPU_Translate() ill tell you in short what it is :
|
This sounds like something that needs to be fixed, but I don't have the time right now to dig into it. If you do look into it further, you can send a pull request or a patch and I'll take it in. |
i think i will make some changes on sdl gpu for the engine im working on , ill back to this later when i need a camera rotation , whenever i add something or fix something ill let you know , im sure that after few months ill have to back to work on the engine's guts and basics but for the moment i don't have to loose time i prefer to move on , don't close this |
i want to get the current projection matrix and store it to a variable so that later i can reuse it ,
i can try this :
how to do that ?
i mean i looking for an equivalent to "glLoadMatrixf(matrix);"
The text was updated successfully, but these errors were encountered: