Skip to content

Commit 1726121

Browse files
committed
update code for latest sokol
1 parent 277051c commit 1726121

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ target_compile_definitions(sokol PRIVATE
122122
USE_DBG_UI
123123
)
124124

125+
set_property(TARGET sokol PROPERTY CXX_STANDARD 14)
126+
127+
125128
if(APPLE)
126129
set_source_files_properties(src/sokol.cpp PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-arc")
127130
endif()

src/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ void init(void) {
172172

173173
// initial clear color
174174
pass_action.colors[0].action = SG_ACTION_CLEAR;
175-
pass_action.colors[0].val[0] = 0.0f;
176-
pass_action.colors[0].val[1] = 0.5f;
177-
pass_action.colors[0].val[2] = 0.7f;
178-
pass_action.colors[0].val[3] = 1.0f;
175+
pass_action.colors[0].value.r = 0.0f;
176+
pass_action.colors[0].value.g = 0.5f;
177+
pass_action.colors[0].value.b = 0.7f;
178+
pass_action.colors[0].value.a = 1.0f;
179179

180180
ImGuiIO & io = ImGui::GetIO();
181181

@@ -211,8 +211,8 @@ void init(void) {
211211
img_desc.wrap_v = SG_WRAP_CLAMP_TO_EDGE;
212212
img_desc.min_filter = SG_FILTER_LINEAR;
213213
img_desc.mag_filter = SG_FILTER_LINEAR;
214-
img_desc.content.subimage[0][0].ptr = font_pixels;
215-
img_desc.content.subimage[0][0].size = font_width * font_height * 4;
214+
img_desc.data.subimage[0][0].ptr = font_pixels;
215+
img_desc.data.subimage[0][0].size = font_width * font_height * 4;
216216
io.Fonts->TexID = (ImTextureID)(uintptr_t) sg_make_image(&img_desc).id;
217217

218218
ImGuiStyle& style = ImGui::GetStyle();

src/sokol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#define SOKOL_TRACE_HOOKS
1515
#define SOKOL_WIN32_FORCE_MAIN
1616

17-
#include "sokol_app.h"
1817
#include "sokol_gfx.h"
18+
#include "sokol_app.h"
1919
#include "sokol_glue.h"
2020
#include "sokol_time.h"
2121
#include "sokol_gl.h"

0 commit comments

Comments
 (0)