Skip to content

Commit

Permalink
Don't use unneeded GL state, works around 11.50b15
Browse files Browse the repository at this point in the history
  • Loading branch information
fpw committed Jul 16, 2020
1 parent c59ab28 commit bf55e27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.9)
project(AviTab VERSION 0.3.19 DESCRIPTION "AviTab X-Plane plugin")
project(AviTab VERSION 0.3.20 DESCRIPTION "AviTab X-Plane plugin")

if (NOT "$ENV{NAVIGRAPH_SECRET}" STREQUAL "")
set(NAVIGRAPH_SECRET "$ENV{NAVIGRAPH_SECRET}" CACHE INTERNAL "Copied from environment variable")
Expand Down
10 changes: 5 additions & 5 deletions src/environment/xplane/XPlaneGUIDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ void XPlaneGUIDriver::setupVRCapture() {
logger::warn("Could not setup VR trigger check: command not found");
return;
}

auto assignmentsRef = XPLMFindDataRef("sim/joystick/joystick_button_assignments");
if (!assignmentsRef) {
logger::warn("Could not setup VR trigger check: assignments ref not found");
return;
}

vrTriggerIndices.clear();

int assignments[3200];
Expand Down Expand Up @@ -266,7 +266,7 @@ void XPlaneGUIDriver::onDraw() {
XPLMBindTexture2d(textureId, 0);
redrawTexture();

XPLMSetGraphicsState(0, 1, 0, 0, 1, 1, 0);
XPLMSetGraphicsState(0, 1, 0, 0, 0, 0, 0);

float b = *brightness;
glColor3f(b, b, b);
Expand All @@ -286,7 +286,7 @@ void XPlaneGUIDriver::onDrawPanel() {
}

if (*panelPowered == 0) {
XPLMSetGraphicsState(0, 0, 0, 0, 1, 1, 0);
XPLMSetGraphicsState(0, 0, 0, 0, 0, 0, 0);
glColor3f(0, 0, 0);
glBegin(GL_QUADS);
glVertex2i(left, bottom);
Expand Down Expand Up @@ -315,7 +315,7 @@ void XPlaneGUIDriver::onDrawPanel() {
XPLMBindTexture2d(textureId, 0);
redrawTexture();

XPLMSetGraphicsState(0, 1, 0, 0, 1, 1, 0);
XPLMSetGraphicsState(0, 1, 0, 0, 0, 0, 0);
float b = *brightness;
glColor3f(b, b, b);
renderWindowTexture(left, top, right, bottom);
Expand Down

0 comments on commit bf55e27

Please sign in to comment.