Merge branch 'master' of https://github.com/tildearrow/furnace into k053260
This commit is contained in:
commit
b07ba72aa3
|
@ -806,7 +806,6 @@ if (BUILD_GUI)
|
||||||
list(APPEND USED_SOURCES ${GUI_SOURCES})
|
list(APPEND USED_SOURCES ${GUI_SOURCES})
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS
|
||||||
extern/imgui_patched
|
extern/imgui_patched
|
||||||
extern/imgui_conf
|
|
||||||
extern/imgui_patched/backends
|
extern/imgui_patched/backends
|
||||||
extern/IconFontCppHeaders
|
extern/IconFontCppHeaders
|
||||||
extern/igfd
|
extern/igfd
|
||||||
|
@ -878,7 +877,7 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(furnace SYSTEM PRIVATE ${DEPENDENCIES_INCLUDE_DIRS})
|
target_include_directories(furnace SYSTEM PRIVATE ${DEPENDENCIES_INCLUDE_DIRS})
|
||||||
target_compile_definitions(furnace PRIVATE ${DEPENDENCIES_DEFINES} IMGUI_USER_CONFIG="imconfig_fur.h")
|
target_compile_definitions(furnace PRIVATE ${DEPENDENCIES_DEFINES})
|
||||||
target_compile_options(furnace PRIVATE ${DEPENDENCIES_COMPILE_OPTIONS})
|
target_compile_options(furnace PRIVATE ${DEPENDENCIES_COMPILE_OPTIONS})
|
||||||
target_link_libraries(furnace PRIVATE ${DEPENDENCIES_LIBRARIES})
|
target_link_libraries(furnace PRIVATE ${DEPENDENCIES_LIBRARIES})
|
||||||
if (PKG_CONFIG_FOUND AND (SYSTEM_FMT OR SYSTEM_LIBSNDFILE OR SYSTEM_ZLIB OR SYSTEM_SDL2 OR SYSTEM_RTMIDI OR WITH_JACK))
|
if (PKG_CONFIG_FOUND AND (SYSTEM_FMT OR SYSTEM_LIBSNDFILE OR SYSTEM_ZLIB OR SYSTEM_SDL2 OR SYSTEM_RTMIDI OR WITH_JACK))
|
||||||
|
|
|
@ -199,16 +199,17 @@
|
||||||
#define IMGUI_IMPL_OPENGL_MAY_HAVE_EXTENSIONS
|
#define IMGUI_IMPL_OPENGL_MAY_HAVE_EXTENSIONS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "../../../src/ta-log.h"
|
||||||
|
|
||||||
// [Debugging]
|
// [Debugging]
|
||||||
//#define IMGUI_IMPL_OPENGL_DEBUG
|
//#define IMGUI_IMPL_OPENGL_DEBUG
|
||||||
#ifdef IMGUI_IMPL_OPENGL_DEBUG
|
#ifdef IMGUI_IMPL_OPENGL_DEBUG
|
||||||
#include <stdio.h>
|
#define GL_CALL(_CALL) do { _CALL; GLenum gl_err = glGetError(); if (gl_err != 0) logE("GL error 0x%x returned from '%s'.\n", gl_err, #_CALL); } while (0) // Call with error check
|
||||||
#define GL_CALL(_CALL) do { _CALL; GLenum gl_err = glGetError(); if (gl_err != 0) fprintf(stderr, "GL error 0x%x returned from '%s'.\n", gl_err, #_CALL); } while (0) // Call with error check
|
|
||||||
#else
|
#else
|
||||||
#define GL_CALL(_CALL) _CALL // Call without error check
|
#define GL_CALL(_CALL) _CALL // Call without error check
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GL_CALL_FALSE(_CALL) _CALL; { GLenum gl_err = glGetError(); if (gl_err != 0) return false; }
|
#define GL_CALL_FALSE(_CALL) _CALL; { GLenum gl_err = glGetError(); if (gl_err != 0) { logW("GL error 0x%x returned from '%s'.\n", gl_err, #_CALL); return false; } }
|
||||||
|
|
||||||
// OpenGL Data
|
// OpenGL Data
|
||||||
struct ImGui_ImplOpenGL3_Data
|
struct ImGui_ImplOpenGL3_Data
|
||||||
|
@ -326,7 +327,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IMGUI_IMPL_OPENGL_DEBUG
|
#ifdef IMGUI_IMPL_OPENGL_DEBUG
|
||||||
printf("GL_MAJOR_VERSION = %d\nGL_MINOR_VERSION = %d\nGL_VENDOR = '%s'\nGL_RENDERER = '%s'\n", major, minor, (const char*)glGetString(GL_VENDOR), (const char*)glGetString(GL_RENDERER)); // [DEBUG]
|
logD("\nGL_VENDOR = '%s'\nGL_RENDERER = '%s'\n", (const char*)glGetString(GL_VENDOR), (const char*)glGetString(GL_RENDERER)); // [DEBUG]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
|
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
|
||||||
|
@ -677,13 +678,19 @@ bool ImGui_ImplOpenGL3_CreateFontsTexture()
|
||||||
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
|
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
|
||||||
GLint last_texture;
|
GLint last_texture;
|
||||||
GL_CALL(glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture));
|
GL_CALL(glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture));
|
||||||
|
// clear errors
|
||||||
|
glGetError();
|
||||||
|
|
||||||
GL_CALL_FALSE(glGenTextures(1, &bd->FontTexture));
|
GL_CALL_FALSE(glGenTextures(1, &bd->FontTexture));
|
||||||
GL_CALL_FALSE(glBindTexture(GL_TEXTURE_2D, bd->FontTexture));
|
GL_CALL_FALSE(glBindTexture(GL_TEXTURE_2D, bd->FontTexture));
|
||||||
GL_CALL_FALSE(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
|
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
|
||||||
GL_CALL_FALSE(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
|
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
|
||||||
#ifdef GL_UNPACK_ROW_LENGTH // Not on WebGL/ES
|
#ifdef GL_UNPACK_ROW_LENGTH // Not on WebGL/ES
|
||||||
GL_CALL_FALSE(glPixelStorei(GL_UNPACK_ROW_LENGTH, 0));
|
GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH, 0));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
glGetError();
|
||||||
|
|
||||||
GL_CALL_FALSE(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels));
|
GL_CALL_FALSE(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels));
|
||||||
|
|
||||||
// Store our identifier
|
// Store our identifier
|
||||||
|
|
4
extern/imgui_patched/imgui.h
vendored
4
extern/imgui_patched/imgui.h
vendored
|
@ -52,9 +52,7 @@ Index of this file:
|
||||||
|
|
||||||
// Configuration file with compile-time options
|
// Configuration file with compile-time options
|
||||||
// (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system')
|
// (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system')
|
||||||
#ifdef IMGUI_USER_CONFIG
|
#include "imconfig_fur.h"
|
||||||
#include IMGUI_USER_CONFIG
|
|
||||||
#endif
|
|
||||||
#include "imconfig.h"
|
#include "imconfig.h"
|
||||||
|
|
||||||
#ifndef IMGUI_DISABLE
|
#ifndef IMGUI_DISABLE
|
||||||
|
|
|
@ -220,7 +220,7 @@ size | description
|
||||||
1 | status
|
1 | status
|
||||||
| - 0: denied
|
| - 0: denied
|
||||||
| - 1: allowed
|
| - 1: allowed
|
||||||
|
```
|
||||||
## 0x13: message
|
## 0x13: message
|
||||||
```
|
```
|
||||||
size | description
|
size | description
|
||||||
|
|
|
@ -3839,6 +3839,7 @@ bool FurnaceGUI::loop() {
|
||||||
ImGui::GetIO().Fonts->Clear();
|
ImGui::GetIO().Fonts->Clear();
|
||||||
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||||
patFont=mainFont;
|
patFont=mainFont;
|
||||||
|
bigFont=mainFont;
|
||||||
if (rend) rend->destroyFontsTexture();
|
if (rend) rend->destroyFontsTexture();
|
||||||
if (!ImGui::GetIO().Fonts->Build()) {
|
if (!ImGui::GetIO().Fonts->Build()) {
|
||||||
logE("error again while building font atlas!");
|
logE("error again while building font atlas!");
|
||||||
|
@ -5978,6 +5979,7 @@ bool FurnaceGUI::loop() {
|
||||||
ImGui::GetIO().Fonts->Clear();
|
ImGui::GetIO().Fonts->Clear();
|
||||||
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||||
patFont=mainFont;
|
patFont=mainFont;
|
||||||
|
bigFont=mainFont;
|
||||||
if (rend) rend->destroyFontsTexture();
|
if (rend) rend->destroyFontsTexture();
|
||||||
if (!ImGui::GetIO().Fonts->Build()) {
|
if (!ImGui::GetIO().Fonts->Build()) {
|
||||||
logE("error again while building font atlas!");
|
logE("error again while building font atlas!");
|
||||||
|
@ -6432,6 +6434,7 @@ bool FurnaceGUI::init() {
|
||||||
ImGui::GetIO().Fonts->Clear();
|
ImGui::GetIO().Fonts->Clear();
|
||||||
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||||
patFont=mainFont;
|
patFont=mainFont;
|
||||||
|
bigFont=mainFont;
|
||||||
if (rend) rend->destroyFontsTexture();
|
if (rend) rend->destroyFontsTexture();
|
||||||
if (!ImGui::GetIO().Fonts->Build()) {
|
if (!ImGui::GetIO().Fonts->Build()) {
|
||||||
logE("error again while building font atlas!");
|
logE("error again while building font atlas!");
|
||||||
|
|
|
@ -3202,6 +3202,7 @@ void FurnaceGUI::commitSettings() {
|
||||||
ImGui::GetIO().Fonts->Clear();
|
ImGui::GetIO().Fonts->Clear();
|
||||||
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||||
patFont=mainFont;
|
patFont=mainFont;
|
||||||
|
bigFont=mainFont;
|
||||||
if (rend) rend->destroyFontsTexture();
|
if (rend) rend->destroyFontsTexture();
|
||||||
if (!ImGui::GetIO().Fonts->Build()) {
|
if (!ImGui::GetIO().Fonts->Build()) {
|
||||||
logE("error again while building font atlas!");
|
logE("error again while building font atlas!");
|
||||||
|
|
|
@ -370,6 +370,13 @@ static void handleTermGUI(int) {
|
||||||
// TODO: CoInitializeEx on Windows?
|
// TODO: CoInitializeEx on Windows?
|
||||||
// TODO: add crash log
|
// TODO: add crash log
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
// uncomment these if you want Furnace to play in the background on Android.
|
||||||
|
// not recommended. it lags.
|
||||||
|
#if defined(HAVE_SDL2) && defined(ANDROID)
|
||||||
|
//SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE,"0");
|
||||||
|
//SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO,"0");
|
||||||
|
#endif
|
||||||
|
|
||||||
// Windows console thing - thanks dj.tuBIG/MaliceX
|
// Windows console thing - thanks dj.tuBIG/MaliceX
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue