mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-30 02:32:46 +01:00
OpenGL: Add support for glFrontFace in the state tracker
This commit is contained in:
parent
87df493b5b
commit
95dbc6eb0e
2 changed files with 6 additions and 0 deletions
|
@ -11,6 +11,7 @@ OpenGLState::OpenGLState() {
|
||||||
// These all match default OpenGL values
|
// These all match default OpenGL values
|
||||||
cull.enabled = false;
|
cull.enabled = false;
|
||||||
cull.mode = GL_BACK;
|
cull.mode = GL_BACK;
|
||||||
|
cull.front_face = GL_CCW;
|
||||||
|
|
||||||
depth.test_enabled = false;
|
depth.test_enabled = false;
|
||||||
depth.test_func = GL_LESS;
|
depth.test_func = GL_LESS;
|
||||||
|
@ -67,6 +68,10 @@ void OpenGLState::Apply() {
|
||||||
glCullFace(cull.mode);
|
glCullFace(cull.mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cull.front_face != cur_state.cull.front_face) {
|
||||||
|
glFrontFace(cull.front_face);
|
||||||
|
}
|
||||||
|
|
||||||
// Depth test
|
// Depth test
|
||||||
if (depth.test_enabled != cur_state.depth.test_enabled) {
|
if (depth.test_enabled != cur_state.depth.test_enabled) {
|
||||||
if (depth.test_enabled) {
|
if (depth.test_enabled) {
|
||||||
|
|
|
@ -11,6 +11,7 @@ public:
|
||||||
struct {
|
struct {
|
||||||
bool enabled; // GL_CULL_FACE
|
bool enabled; // GL_CULL_FACE
|
||||||
GLenum mode; // GL_CULL_FACE_MODE
|
GLenum mode; // GL_CULL_FACE_MODE
|
||||||
|
GLenum front_face; // GL_FRONT_FACE
|
||||||
} cull;
|
} cull;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
Loading…
Reference in a new issue