Let ImGUI explicitely use GLAD to load OpenGL functionalities
This commit is contained in:
parent
bc813ad9cd
commit
93cf23344d
|
@ -9,7 +9,7 @@ target_sources(yabgbe PUBLIC ${OTHER_SOURCES})
|
|||
target_include_directories(yabgbe
|
||||
PUBLIC
|
||||
"${CMAKE_SOURCE_DIR}/vendor/imgui/include"
|
||||
"${CMAKE_SOURCE_DIR}/vendor/glad/include"
|
||||
"${CMAKE_SOURCE_DIR}/vendor/glad/include/glad/"
|
||||
SDL2
|
||||
)
|
||||
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
#include <iostream>
|
||||
|
||||
#include <SDL.h>
|
||||
#include <imgui.h>
|
||||
#include <glad.h>
|
||||
#define IMGUI_IMPL_OPENGL_LOADER_GLAD
|
||||
#include <imgui_impl_opengl3.h>
|
||||
#include <imgui_sdl.h>
|
||||
|
||||
static BYTE colormap[4] = { 0b00000000, 0b00100101, 0b01001010, 0b10010011 };
|
||||
|
@ -37,6 +39,11 @@ int main(int argc, char** argv)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if(!gladLoadGL())
|
||||
{
|
||||
std::cerr << "Failed to load GL" << std::endl;
|
||||
}
|
||||
|
||||
SDL_Event e;
|
||||
|
||||
// Initialize ImGui
|
||||
|
|
2
vendor/glad/src/glad.c
vendored
2
vendor/glad/src/glad.c
vendored
|
@ -22,7 +22,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glad/glad.h>
|
||||
#include "../glad/glad.h"
|
||||
|
||||
static void* get_proc(const char *namez);
|
||||
|
||||
|
|
5
vendor/imgui/include/imconfig.h
vendored
5
vendor/imgui/include/imconfig.h
vendored
|
@ -8,6 +8,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This makes sure imgui uses glad
|
||||
#define IMGUI_IMPL_OPENGL_LOADER_GLAD
|
||||
|
||||
//---- Define assertion handler. Defaults to calling assert().
|
||||
// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
|
||||
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
|
||||
|
@ -99,4 +102,4 @@ namespace ImGui
|
|||
{
|
||||
void MyFunction(const char* name, const MyMatrix44& v);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue