Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
WinteryFox committed Nov 22, 2023
1 parent 92eb8b2 commit 48ab356
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/engine/gl/GlShaderModule.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#include "GlShaderModule.h"

namespace Vixen::Gl {
GlShaderModule::GlShaderModule(Stage stage, const std::string &source, const std::string &entry)
: ShaderModule(stage, entry, {}, {}), module(0) {
GlShaderModule::GlShaderModule(const Stage stage, const std::string& source, const std::string& entry)
: ShaderModule(stage, entry, {}, {}, {}),
module(0) {
switch (stage) {
case Stage::VERTEX:
module = glCreateShader(GL_VERTEX_SHADER);
break;
case Stage::FRAGMENT:
module = glCreateShader(GL_FRAGMENT_SHADER);
break;
default:
spdlog::error("Unsupported shader stage");
throw std::runtime_error("Unsupported shader stage");
case Stage::VERTEX:
module = glCreateShader(GL_VERTEX_SHADER);
break;
case Stage::FRAGMENT:
module = glCreateShader(GL_FRAGMENT_SHADER);
break;
default:
spdlog::error("Unsupported shader stage");
throw std::runtime_error("Unsupported shader stage");
}
auto src = source.c_str();
glShaderSource(module, 1, &src, nullptr);
Expand Down

0 comments on commit 48ab356

Please sign in to comment.