Comments (4)
Those declarations are required by sokol_gfx_imgui.h, you'll need to include at least sokol_gfx.h and sokol_imgui.h before sokol_gfx_imgui.h, only sokol_app.h is optional (that's because sokol_gfx_imgui.h needs to use those new-ish simgui_image_t handles for rendering UI-embedded textures via sokol_imgui.h, this is a relatively recent change).
The decision to require the user to include dependency headers for "layer 2 headers" (instead of integrating those include statements in the headers) might be a bit untraditional, but it was a conscious decision :)
E.g. everywhere where you include sokol_gfx_imgui.h, you need an include-chain like this:
#include "sokol_gfx.h"
#include "sokol_imgui.h"
#include "sokol_gfx_imgui.h"
...and if you don't define SOKOL_IMGUI_NO_SOKOL_APP
on the build system level, it should look like this:
#define SOKOL_IMGUI_NO_SOKOL_APP
#include "sokol_gfx.h"
#include "sokol_imgui.h"
#include "sokol_gfx_imgui.h"
from sokol.
Correct, but the sokol_app.h dependency can be removed with a define SOKOL_IMGUI_NO_SOKOL_APP
before including sokol_imgui.h.
See:
Lines 35 to 38 in 5b6b743
And:
Lines 78 to 82 in 5b6b743
...e.g. if you use SDL2, you would need to take care yourself to feed input event from SDL into Dear ImGui (there's also a couple other things in sokol_imgui.h like clipboard support, but those should all be inside an #ifdef SOKOL_IMGUI_NO_SOKOL_APP
.
PS: there's actually a small error in the documentation, I will correct that now:
define SOKOL_IMGUI_NO_SOKOL_APP before including the implementation
...this is no longer correct, it must also be defined before including the declaration (maybe best to define SOKOL_IMGUI_NO_SOKOL_APP on the build system level).
from sokol.
Don't know how I missed that... Sorry! Thanks!
from sokol.
I reopened because while I have the define set: SOKOL_IMGUI_NO_SOKOL_APP
, the compilation is failing:
In file included from C:\dev\destral_zig\src\deps\sokol\destral_sokol_gfx.c:12:
C:\dev\destral_zig\src\deps\sokol/sokol_gfx_imgui.h:263:5: error: unknown type name 'simgui_image_t'
C:\dev\destral_zig\src\deps\sokol/sokol_gfx_imgui.h:1582:5: error: use of undeclared identifier 'simgui_image_desc_t'
C:\dev\destral_zig\src\deps\sokol/sokol_gfx_imgui.h:1583:22: error: use of undeclared identifier 'simgui_img_desc'
C:\dev\destral_zig\src\deps\sokol/sokol_gfx_imgui.h:1583:46: error: use of undeclared identifier 'simgui_img_desc'
C:\dev\destral_zig\src\deps\sokol/sokol_gfx_imgui.h:1584:5: error: use of undeclared identifier 'simgui_img_desc'
C:\dev\destral_zig\src\deps\sokol/sokol_gfx_imgui.h:1586:23: error: call to undeclared function 'simgui_make_image'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
C:\dev\destral_zig\src\deps\sokol/sokol_gfx_imgui.h:1586:42: error: use of undeclared identifier 'simgui_img_desc'
C:\dev\destral_zig\src\deps\sokol/sokol_gfx_imgui.h:1593:5: error: call to undeclared function 'simgui_destroy_image'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
C:\dev\destral_zig\src\deps\sokol/sokol_gfx_imgui.h:3410:21: error: call to undeclared function 'simgui_imtextureid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
These functions and types are not ifdefed. Have we to provide these?
from sokol.
Related Issues (20)
- GL Shader compilation error not shown if OpenGL doesn't provide an error log
- sokol_app.h: fix scroll event values (WHEEL_DELTA vs 30.0f) HOT 1
- Remove SG_FILTER_NONE
- D3D11 backend: allow injected textures to not have a shader-resource-view.
- Add backend-specific resource info functions.
- What is the recommended version that still supports GLES2? HOT 1
- stale default framebuffer bound at end of offscreen pass HOT 5
- sokol_gfx: Issue creating render target HOT 17
- GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER: vertex attribute not found in shader (gl) HOT 3
- Compiling into a DLL with cimgui/sokol_imgui included HOT 12
- Crash in multithreaded code HOT 1
- Expose _sg_pixelformat_bytesize to users? HOT 4
- sokol_gfx: Validation error when creating offscreen pass. HOT 2
- Suggestion: Show labels in validation errors HOT 2
- Android builds without fips? HOT 4
- Help: Sampler type on per-texture basis HOT 2
- sokol-samples : `fips build` error HOT 4
- sokol_nuklear.h: how to know if nuklear handled an event HOT 3
- const void *sapp_metal_get_device(void): Assertion `_sapp.valid' failed.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sokol.