-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GL::State & Texture bind cosmetic (#927)
* Texture binding cosmetic Eliminate "duplicate" of FormatToQuery (Format2Query), move FormatToQuery -> TextureFormat.h and make it extern (only 1 instance among all units). Gate unaccepted texture targets for Lua via switch. * GL::State State is implemented as a namespace. Use it like this: using namespace GL::State; auto stateChange = StateChange(DepthMask(GL_TRUE), Viewport(0,0,1,1)); ... stateChange.pop() or { auto stateChange = StateChange(...); ... // stateChange destructed } Unknown status is implemented via union. It should be safe, no practical value should collide with it. * Update GL::State Enabled "capability" ("binary") attributes Corrected previous union usage, it now uses a pair (not optional, because it works with values when false) Todo: BindTexture, ClipDistance * Update, should be ready StateChange > PushState PushState should be ready, but is not test yet. Shall be testing. +ClipDistance attribute. Note, it doesn't check how many clip distances are available, it just runs gl function as it should. Check clip distances, if you need, prior to ClipDistance code. Replace glPushAttrib with PushState in some places where its easy * >SubState + operator << PushState > SubState Add operator << to modify state
- Loading branch information
1 parent
81653a4
commit b60cb19
Showing
18 changed files
with
638 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "State.h" | ||
|
||
decltype(GL::State::Attributes) GL::State::Attributes; |
Oops, something went wrong.
b60cb19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Krogoth100 the code does not compile on MSVC.
b60cb19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c5f8474