Revert unneeded changes

This commit is contained in:
David Chavez 2022-05-31 00:29:01 +02:00
commit 1232e0038d
5 changed files with 9 additions and 21 deletions

View file

@ -1,7 +1,5 @@
#include "../../Window.h"
#ifdef ENABLE_OPENGL
#endif
#if 1
#include <stdint.h>
#include <stdbool.h>
@ -466,7 +464,6 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
puts(fs_buf);
puts("End");*/
const GLchar *sources[2] = { vs_buf, fs_buf };
const GLint lengths[2] = { (GLint) vs_len, (GLint) fs_len };
GLint success;
@ -479,9 +476,9 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
GLint max_length = 0;
glGetShaderiv(vertex_shader, GL_INFO_LOG_LENGTH, &max_length);
char error_log[1024];
fprintf(stderr, "Vertex shader compilation failed\n");
//fprintf(stderr, "Vertex shader compilation failed\n");
glGetShaderInfoLog(vertex_shader, max_length, &max_length, &error_log[0]);
fprintf(stderr, "%s\n", &error_log[0]);
//fprintf(stderr, "%s\n", &error_log[0]);
abort();
}

View file

@ -139,17 +139,6 @@ static void gfx_sdl_init(const char *game_name, bool start_in_fullscreen) {
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
#if 0
#ifdef __APPLE__
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
// This is important on macOS
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG);
// specify depth buffer, etc
#endif
#endif
#ifndef __linux
#ifndef __APPLE__
timer = CreateWaitableTimer(nullptr, false, nullptr);

View file

@ -126,7 +126,7 @@ struct ImGui_ImplGlfw_Data
GLFWcharfun PrevUserCallbackChar;
GLFWmonitorfun PrevUserCallbackMonitor;
ImGui_ImplGlfw_Data() { /*memset(this, 0, sizeof(*this));*/ }
ImGui_ImplGlfw_Data() { memset(this, 0, sizeof(*this)); }
};
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts

View file

@ -216,13 +216,11 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
IM_ASSERT(io.BackendRendererUserData == NULL && "Already initialized a renderer backend!");
// Initialize our loader
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3) && !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM) || 0
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3) && !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
if (imgl3wInit() != 0)
{
fprintf(stderr, "Failed to initialize OpenGL loader!\n");
#ifndef __APPLE__ // this is ok due to shared library cache
return false;
#endif
}
#endif

View file

@ -652,8 +652,12 @@ static int parse_version(void)
return GL3W_ERROR_INIT;
glGetIntegerv(GL_MAJOR_VERSION, &version.major);
glGetIntegerv(GL_MINOR_VERSION, &version.minor);
#ifndef __APPLE__
if (version.major < 3)
return GL3W_ERROR_OPENGL_VERSION;
#endif
return GL3W_OK;
}