Skip to content

Commit

Permalink
Merge pull request #376 from avaraline/exit-on-shader-compilation-fai…
Browse files Browse the repository at this point in the history
…lure

exit on shader compilation failure
  • Loading branch information
assertivist authored Dec 22, 2023
2 parents 84590a4 + 78923ac commit 6538f2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/CHUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bool sortByScore(std::pair<PlayerScoreRecord, int> i, std::pair<PlayerScoreRecor
}

void CHUD::LoadImages(NVGcontext *ctx) {
images = nvgCreateImage(ctx, "rsrc/img/atlas.png", NULL);
images = nvgCreateImage(ctx, "rsrc/img/atlas.png", 0);
}

void CHUD::DrawScore(std::vector<CPlayerManager*>& thePlayers, int chudHeight, CViewParameters *view, NVGcontext *ctx) {
Expand Down
5 changes: 5 additions & 0 deletions src/util/AvaraGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,11 @@ GLuint LoadShaders(const char *vertex_file_path, const char *fragment_file_path)
printf("%s\n", &FragmentShaderErrorMessage[0]);
}

if (Result == GL_FALSE) {
// exit on shader compilation failure
exit(1);
}

// Link the program
fprintf(stderr, "Linking program\n");
GLuint ProgramID = glCreateProgram();
Expand Down

0 comments on commit 6538f2d

Please sign in to comment.