mirror of
https://github.com/shadps4-emu/ext-imgui.git
synced 2024-11-27 20:20:40 +00:00
Fix SDL2-example for Linux
The header is called "SDL_opengl.h" - case matters on Linux. The main() function must indeed be called main(), on Windows it'll be renamed to SDL_main (for SDL2main.lib) by #define in SDL_main.h (which is included by SDL.h) I added an entry to the example's README that describes how to build it on Linux.
This commit is contained in:
parent
3ff04c95d5
commit
02a0967243
@ -8,3 +8,9 @@
|
|||||||
```
|
```
|
||||||
cl /MD /I <sdl2path\include> /I ..\.. main.cpp imgui_impl_sdl.cpp ..\..\imgui.cpp /link /LIBPATH:<sdl2path\lib> SDL2.lib SDL2main.lib
|
cl /MD /I <sdl2path\include> /I ..\.. main.cpp imgui_impl_sdl.cpp ..\..\imgui.cpp /link /LIBPATH:<sdl2path\lib> SDL2.lib SDL2main.lib
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- On Linux and similar Unices
|
||||||
|
|
||||||
|
```
|
||||||
|
c++ `sdl2-config --cflags` -I ../.. main.cpp imgui_impl_sdl.cpp ../../imgui.cpp `sdl2-config --libs` -lGL -o sdl2example
|
||||||
|
```
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_syswm.h>
|
#include <SDL_syswm.h>
|
||||||
#include <SDL_OpenGL.h>
|
#include <SDL_opengl.h>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include "imgui_impl_sdl.h"
|
#include "imgui_impl_sdl.h"
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
#include "imgui_impl_sdl.h"
|
#include "imgui_impl_sdl.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_OpenGL.h>
|
#include <SDL_opengl.h>
|
||||||
|
|
||||||
int SDL_main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
// Setup SDL
|
// Setup SDL
|
||||||
if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
|
if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user