Compare commits

..

No commits in common. "75bda91302ba312ca3c903545b6be61e1d0c41c0" and "521483f4e054750af764575c7b228223b978da2d" have entirely different histories.

3 changed files with 4 additions and 14 deletions

View File

@ -72,10 +72,10 @@ class Buffer : public OpenGLObject {
if (_id) {
glBindBuffer(Target, _id);
} else {
WARN(BufferError(
THROW(BufferError(
Codes::INVALID_BUFFER,
"w/ BufferType " + BufferTypes.at(Target)
), 0xFE);
));
}
}
virtual void unbind() const override { glBindBuffer(Target, 0); }

View File

@ -17,13 +17,7 @@ const ErrorCodeMap ProgramError::ErrorMessages = {
Shader::Shader(GLenum target_, const std::string& source_) : target(target_) {
declare();
const char* src_ptr= source_.data();
glShaderSource(_id, 1, &src_ptr, NULL);
glCompileShader(_id);
_success = status(GL_COMPILE_STATUS);
if (!_success) {
WARN(log(), 0x0FE);
}
}
Shader::Shader(Shader&& cpy) : target(cpy.target) {
@ -55,7 +49,7 @@ Program::Program(SharedVector<Shader> shaders_) {
glLinkProgram(_id);
_success = status(GL_LINK_STATUS);
if (!_success) {
WARN(log(), 0x0FE);
WARN(log(), 0x01);
}
}

View File

@ -5,7 +5,7 @@
int main() {
nb::logger.log("Howdy!");
nb::Window window(400, 400, "Hello!");
nb::Window window(200, 200, "Hello!");
window.setWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
window.setWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
window.init();
@ -56,10 +56,6 @@ int main() {
GLFWwindow* window_ptr = window.getWindow();
while(!glfwWindowShouldClose(window_ptr)) {
glDrawArrays(GL_TRIANGLES, 0, 3);
glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glfwPollEvents();
glfwSwapBuffers(window_ptr);
}
return 0;