Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions demo/sdl3_opengl3_opengles3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 3.16)
project(nuklear_sdl3
DESCRIPTION "nuklear_sdl3: Nuklear Immediate Mode GUI for SDL3"
HOMEPAGE_URL "https://github.com/Immediate-Mode-UI/Nuklear/"
LANGUAGES C
)


# glad
add_subdirectory(glad)
target_include_directories(glad PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/glad/include)
# nuklear
add_library(nuklear INTERFACE)
target_include_directories(nuklear INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/../..)

# nuklear_sdl3
add_library(nuklear_sdl3 INTERFACE)
target_include_directories(nuklear_sdl3 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

find_package(SDL3 REQUIRED)

add_executable(nuklear_sdl3_ogl3
nuklear_sdl3_ogl3.c
)

target_link_libraries(nuklear_sdl3_ogl3 PUBLIC
nuklear
nuklear_sdl3
SDL3::SDL3
glad
)


set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT "nuklear_sdl3_ogl3")


set_property(TARGET nuklear_sdl3_ogl3 PROPERTY C_STANDARD 99)
4 changes: 4 additions & 0 deletions demo/sdl3_opengl3_opengles3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SDL3 OpenGL/ES 3.x Example with Nuklear


- This is a simple example demonstrating how to use SDL3 with OpenGL 3.x or OpenGL ES 3.x along with the Nuklear immediate mode GUI library, it can be compiled for desktop, web or mobile platforms.
9 changes: 9 additions & 0 deletions demo/sdl3_opengl3_opengles3/cmake/FindSDL3.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include(FetchContent)
FetchContent_Declare(
SDL3
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
GIT_TAG release-3.2.4
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(SDL3)

8 changes: 8 additions & 0 deletions demo/sdl3_opengl3_opengles3/glad/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.18)

project(glad)

add_library(glad STATIC)

target_sources(glad PRIVATE src/glad.c)
target_include_directories(glad PUBLIC include)
Loading