mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
don't export functions from imgui integration implementation
This commit is contained in:
parent
3586f49762
commit
bffe816037
6 changed files with 25 additions and 18 deletions
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
project(libsuperderpy C CXX)
|
||||
project(libsuperderpy C)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
|
|
|
@ -6,11 +6,21 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
|
|||
|
||||
set(EMSCRIPTEN_TOTAL_MEMORY "128" CACHE STRING "Amount of memory allocated by Emscripten (MB, must be multiple of 16)" )
|
||||
|
||||
option(LIBSUPERDERPY_IMGUI "Compile with Dear ImGui support." OFF)
|
||||
if (LIBSUPERDERPY_IMGUI)
|
||||
enable_language(CXX)
|
||||
add_definitions(-DLIBSUPERDERPY_IMGUI)
|
||||
endif (LIBSUPERDERPY_IMGUI)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_STANDARD_REQUIRED true)
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -ffast-math")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-return-type-c-linkage -ffast-math")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -ffast-math")
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage")
|
||||
endif()
|
||||
|
||||
if(MAEMO5)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
|
@ -59,11 +69,6 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
|
|||
SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
|
||||
endif(LIBSUPERDERPY_STATIC_DEPS)
|
||||
|
||||
option(LIBSUPERDERPY_IMGUI "Compile with Dear ImGui support." OFF)
|
||||
if (LIBSUPERDERPY_IMGUI)
|
||||
add_definitions(-DLIBSUPERDERPY_IMGUI)
|
||||
endif (LIBSUPERDERPY_IMGUI)
|
||||
|
||||
if(MAEMO5)
|
||||
add_definitions(-DMAEMO5=1)
|
||||
add_definitions(-D_Noreturn=)
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
|
||||
|
||||
#include "imgui/imgui_impl_allegro5.h"
|
||||
#include "internal.h"
|
||||
#include <float.h>
|
||||
#include <stdint.h> // uint64_t
|
||||
#include <string.h> // memcpy
|
||||
|
@ -55,7 +54,7 @@ typedef struct ImDrawVertAllegro ImDrawVertAllegro;
|
|||
|
||||
// Render function.
|
||||
// (this used to be set in io->RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
|
||||
SYMBOL_EXPORT void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data) {
|
||||
SYMBOL_INTERNAL void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data) {
|
||||
// Backup Allegro state that will be modified
|
||||
ALLEGRO_TRANSFORM last_transform = *al_get_current_transform();
|
||||
ALLEGRO_TRANSFORM last_projection_transform = *al_get_current_projection_transform();
|
||||
|
@ -139,7 +138,7 @@ SYMBOL_EXPORT void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data) {
|
|||
al_use_projection_transform(&last_projection_transform);
|
||||
}
|
||||
|
||||
SYMBOL_EXPORT bool ImGui_ImplAllegro5_CreateDeviceObjects() {
|
||||
SYMBOL_INTERNAL bool ImGui_ImplAllegro5_CreateDeviceObjects() {
|
||||
// Build texture atlas
|
||||
ImGuiIO* io = igGetIO();
|
||||
unsigned char* pixels;
|
||||
|
@ -180,7 +179,7 @@ SYMBOL_EXPORT bool ImGui_ImplAllegro5_CreateDeviceObjects() {
|
|||
return true;
|
||||
}
|
||||
|
||||
SYMBOL_EXPORT void ImGui_ImplAllegro5_InvalidateDeviceObjects() {
|
||||
SYMBOL_INTERNAL void ImGui_ImplAllegro5_InvalidateDeviceObjects() {
|
||||
if (g_Texture) {
|
||||
al_destroy_bitmap(g_Texture);
|
||||
igGetIO()->Fonts->TexID = NULL;
|
||||
|
@ -202,7 +201,7 @@ static void ImGui_ImplAllegro5_SetClipboardText(void* data, const char* text) {
|
|||
}
|
||||
#endif
|
||||
|
||||
SYMBOL_EXPORT bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display) {
|
||||
SYMBOL_INTERNAL bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display) {
|
||||
g_Display = display;
|
||||
|
||||
// Setup back-end capabilities flags
|
||||
|
@ -251,7 +250,7 @@ SYMBOL_EXPORT bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display) {
|
|||
return true;
|
||||
}
|
||||
|
||||
SYMBOL_EXPORT void ImGui_ImplAllegro5_Shutdown() {
|
||||
SYMBOL_INTERNAL void ImGui_ImplAllegro5_Shutdown() {
|
||||
ImGui_ImplAllegro5_InvalidateDeviceObjects();
|
||||
g_Display = NULL;
|
||||
|
||||
|
@ -266,7 +265,7 @@ SYMBOL_EXPORT void ImGui_ImplAllegro5_Shutdown() {
|
|||
// - When io->WantCaptureMouse is true, do not dispatch mouse input data to your main application.
|
||||
// - When io->WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
|
||||
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
|
||||
SYMBOL_EXPORT bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* ev) {
|
||||
SYMBOL_INTERNAL bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* ev) {
|
||||
ImGuiIO* io = igGetIO();
|
||||
|
||||
switch (ev->type) {
|
||||
|
@ -366,7 +365,7 @@ static void ImGui_ImplAllegro5_UpdateMouseCursor() {
|
|||
}
|
||||
}
|
||||
|
||||
SYMBOL_EXPORT void ImGui_ImplAllegro5_NewFrame() {
|
||||
SYMBOL_INTERNAL void ImGui_ImplAllegro5_NewFrame() {
|
||||
if (!g_Texture) {
|
||||
ImGui_ImplAllegro5_CreateDeviceObjects();
|
||||
}
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
#endif
|
||||
|
||||
#include "3rdparty/cimgui/cimgui.h"
|
||||
#include "libsuperderpy.h"
|
||||
#include <stdbool.h>
|
||||
#include "internal.h"
|
||||
|
||||
bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display);
|
||||
void ImGui_ImplAllegro5_Shutdown(void);
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
#define LIBSUPERDERPY_INTERNAL_H
|
||||
|
||||
#include "libsuperderpy.h"
|
||||
#ifdef LIBSUPERDERPY_IMGUI
|
||||
#include "imgui/imgui_impl_allegro5.h"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
#define SYMBOL_INTERNAL
|
||||
|
|
|
@ -80,7 +80,8 @@ struct GamestateResources;
|
|||
#endif
|
||||
|
||||
#ifdef LIBSUPERDERPY_IMGUI
|
||||
#include "imgui/imgui_impl_allegro5.h"
|
||||
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS 1
|
||||
#include "3rdparty/cimgui/cimgui.h"
|
||||
#endif
|
||||
|
||||
#define LIBSUPERDERPY_BITMAP_HASHMAP_BUCKETS 16
|
||||
|
|
Loading…
Reference in a new issue