Skip to content

Commit

Permalink
Merge pull request #5 from ptxmac/optional-backend
Browse files Browse the repository at this point in the history
Make glfw backend optional
  • Loading branch information
AllenDang authored Sep 5, 2022
2 parents 28028fd + 67e03bb commit ed7c135
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if defined(CIMGUI_GO_USE_GLFW)
#define GL_SILENCE_DEPRECATION
#define CIMGUI_USE_GLFW
#define CIMGUI_USE_OPENGL3
Expand Down Expand Up @@ -276,3 +277,5 @@ void igDeleteTexture(ImTextureID id) {
void igGLFWWindow_GetDisplaySize(GLFWwindow *window, int *width, int *height) {
glfwGetWindowSize(window, width, height);
}

#endif
4 changes: 4 additions & 0 deletions backend.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cimgui_glfw
// +build cimgui_glfw

package cimgui

// #cgo amd64,linux LDFLAGS: ${SRCDIR}/lib/linux/x64/libglfw3.a -ldl -lGL -lX11
Expand All @@ -7,6 +10,7 @@ package cimgui
// #cgo arm64,darwin LDFLAGS: ${SRCDIR}/lib/macos/arm64/libglfw3.a
// #cgo !gles2,darwin LDFLAGS: -framework OpenGL
// #cgo gles2,darwin LDFLAGS: -lGLESv2
// #cgo CPPFLAGS: -DCIMGUI_GO_USE_GLFW
// extern void glfwWindowLoopCallback();
// extern void glfwBeforeRender();
// extern void glfwAfterRender();
Expand Down
3 changes: 3 additions & 0 deletions texture.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cimgui_glfw
// +build cimgui_glfw

package cimgui

import (
Expand Down

0 comments on commit ed7c135

Please sign in to comment.