mirror of
https://github.com/libretro/RetroArch
synced 2025-04-11 00:44:20 +00:00
commit
23064f0590
@ -276,6 +276,7 @@ static void nk_menu_init_device(nk_menu_handle_t *nk)
|
|||||||
nk->icons.page_off = nk_common_image_load(buf);
|
nk->icons.page_off = nk_common_image_load(buf);
|
||||||
|
|
||||||
nk->size_changed = true;
|
nk->size_changed = true;
|
||||||
|
nk_common_set_style(&nk->ctx, THEME_BLUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *nk_menu_init(void **userdata)
|
static void *nk_menu_init(void **userdata)
|
||||||
@ -300,7 +301,6 @@ static void *nk_menu_init(void **userdata)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
*userdata = nk;
|
*userdata = nk;
|
||||||
|
|
||||||
fill_pathname_join(nk->assets_directory, settings->directory.assets,
|
fill_pathname_join(nk->assets_directory, settings->directory.assets,
|
||||||
"nuklear", sizeof(nk->assets_directory));
|
"nuklear", sizeof(nk->assets_directory));
|
||||||
nk_menu_init_device(nk);
|
nk_menu_init_device(nk);
|
||||||
|
@ -282,3 +282,4 @@ void nk_common_mem_free(nk_handle unused, void *ptr)
|
|||||||
(void)unused;
|
(void)unused;
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,87 +1,89 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
/* RetroArch - A frontend for libretro.
|
||||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||||
* Copyright (C) 2014-2015 - Jean-André Santoni
|
* Copyright (C) 2014-2015 - Jean-André Santoni
|
||||||
* Copyright (C) 2016 - Andrés Suárez
|
* Copyright (C) 2016 - Andrés Suárez
|
||||||
*
|
*
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
* of the GNU General Public License as published by the Free Software Found-
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NK_COMMON_H
|
#ifndef _NK_COMMON_H
|
||||||
#define _NK_COMMON_H
|
#define _NK_COMMON_H
|
||||||
|
|
||||||
/* This file is intended for backend code. */
|
/* This file is intended for backend code. */
|
||||||
|
|
||||||
#define NK_INCLUDE_FIXED_TYPES
|
#define NK_INCLUDE_FIXED_TYPES
|
||||||
#define NK_INCLUDE_STANDARD_IO
|
#define NK_INCLUDE_STANDARD_IO
|
||||||
#define NK_INCLUDE_DEFAULT_ALLOCATOR
|
#define NK_INCLUDE_DEFAULT_ALLOCATOR
|
||||||
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
|
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
|
||||||
#define NK_INCLUDE_FONT_BAKING
|
#define NK_INCLUDE_FONT_BAKING
|
||||||
#define NK_INCLUDE_DEFAULT_FONT
|
#define NK_INCLUDE_DEFAULT_FONT
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "../../../deps/nuklear/nuklear.h"
|
#include "../../../deps/nuklear/nuklear.h"
|
||||||
#include "../../../deps/stb/stb_image.h"
|
#include "../../../deps/stb/stb_image.h"
|
||||||
|
|
||||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||||
#include "../../../gfx/common/gl_common.h"
|
#include "../../../gfx/common/gl_common.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAX_VERTEX_MEMORY (512 * 1024)
|
#define MAX_VERTEX_MEMORY (512 * 1024)
|
||||||
#define MAX_ELEMENT_MEMORY (128 * 1024)
|
#define MAX_ELEMENT_MEMORY (128 * 1024)
|
||||||
|
|
||||||
#define NK_SYSTEM_TAB_END NK_SYSTEM_TAB_SETTINGS
|
#define NK_SYSTEM_TAB_END NK_SYSTEM_TAB_SETTINGS
|
||||||
|
|
||||||
struct nk_device
|
struct nk_device
|
||||||
{
|
{
|
||||||
struct nk_buffer cmds;
|
struct nk_buffer cmds;
|
||||||
struct nk_draw_null_texture null;
|
struct nk_draw_null_texture null;
|
||||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||||
GLuint vbo, vao, ebo;
|
GLuint vbo, vao, ebo;
|
||||||
|
|
||||||
GLuint prog;
|
GLuint prog;
|
||||||
GLuint vert_shdr;
|
GLuint vert_shdr;
|
||||||
GLuint frag_shdr;
|
GLuint frag_shdr;
|
||||||
|
|
||||||
GLint attrib_pos;
|
GLint attrib_pos;
|
||||||
GLint attrib_uv;
|
GLint attrib_uv;
|
||||||
GLint attrib_col;
|
GLint attrib_col;
|
||||||
|
|
||||||
GLint uniform_proj;
|
GLint uniform_proj;
|
||||||
GLuint font_tex;
|
GLuint font_tex;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct nk_font *font;
|
extern struct nk_font *font;
|
||||||
extern struct nk_font_atlas atlas;
|
extern struct nk_font_atlas atlas;
|
||||||
extern struct nk_user_font usrfnt;
|
extern struct nk_user_font usrfnt;
|
||||||
extern struct nk_allocator nk_alloc;
|
extern struct nk_allocator nk_alloc;
|
||||||
extern struct nk_device device;
|
extern struct nk_device device;
|
||||||
|
|
||||||
struct nk_image nk_common_image_load(const char *filename);
|
enum theme {THEME_BLACK, THEME_WHITE, THEME_RED, THEME_BLUE, THEME_DARK};
|
||||||
|
|
||||||
char* nk_common_file_load(const char* path, size_t* size);
|
struct nk_image nk_common_image_load(const char *filename);
|
||||||
|
|
||||||
void nk_common_device_init(struct nk_device *dev);
|
char* nk_common_file_load(const char* path, size_t* size);
|
||||||
|
|
||||||
void nk_common_device_shutdown(struct nk_device *dev);
|
void nk_common_device_init(struct nk_device *dev);
|
||||||
|
|
||||||
void nk_common_device_draw(struct nk_device *dev,
|
void nk_common_device_shutdown(struct nk_device *dev);
|
||||||
struct nk_context *ctx, int width, int height,
|
|
||||||
enum nk_anti_aliasing AA);
|
void nk_common_device_draw(struct nk_device *dev,
|
||||||
|
struct nk_context *ctx, int width, int height,
|
||||||
void* nk_common_mem_alloc(nk_handle a, void *old, nk_size b);
|
enum nk_anti_aliasing AA);
|
||||||
|
|
||||||
void nk_common_mem_free(nk_handle unused, void *ptr);
|
void* nk_common_mem_alloc(nk_handle a, void *old, nk_size b);
|
||||||
|
|
||||||
void device_upload_atlas(struct nk_device *dev, const void *image, int width, int height);
|
void nk_common_mem_free(nk_handle unused, void *ptr);
|
||||||
|
|
||||||
#endif
|
void device_upload_atlas(struct nk_device *dev, const void *image, int width, int height);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -1,37 +1,166 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
/* RetroArch - A frontend for libretro.
|
||||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||||
* Copyright (C) 2014-2015 - Jean-André Santoni
|
* Copyright (C) 2014-2015 - Jean-André Santoni
|
||||||
* Copyright (C) 2016 - Andrés Suárez
|
* Copyright (C) 2016 - Andrés Suárez
|
||||||
*
|
*
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
* of the GNU General Public License as published by the Free Software Found-
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This file is intended for helper functions, custom controls, etc. */
|
/* This file is intended for helper functions, custom controls, etc. */
|
||||||
|
|
||||||
#include "nk_menu.h"
|
#include "nk_menu.h"
|
||||||
|
|
||||||
/* sets window position and size */
|
/* sets window position and size */
|
||||||
void nk_wnd_set_state(nk_menu_handle_t *zr, const int id,
|
void nk_wnd_set_state(nk_menu_handle_t *nk, const int id,
|
||||||
struct nk_vec2 pos, struct nk_vec2 size)
|
struct nk_vec2 pos, struct nk_vec2 size)
|
||||||
{
|
{
|
||||||
zr->window[id].position = pos;
|
nk->window[id].position = pos;
|
||||||
zr->window[id].size = size;
|
nk->window[id].size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* gets window position and size */
|
/* gets window position and size */
|
||||||
void nk_wnd_get_state(nk_menu_handle_t *zr, const int id,
|
void nk_wnd_get_state(nk_menu_handle_t *nk, const int id,
|
||||||
struct nk_vec2 *pos, struct nk_vec2 *size)
|
struct nk_vec2 *pos, struct nk_vec2 *size)
|
||||||
{
|
{
|
||||||
*pos = zr->window[id].position;
|
*pos = nk->window[id].position;
|
||||||
*size = zr->window[id].size;
|
*size = nk->window[id].size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* sets the theme */
|
||||||
|
void nk_common_set_style(struct nk_context *ctx, enum theme theme)
|
||||||
|
{
|
||||||
|
struct nk_color table[NK_COLOR_COUNT];
|
||||||
|
if (theme == THEME_WHITE) {
|
||||||
|
table[NK_COLOR_TEXT] = nk_rgba(70, 70, 70, 255);
|
||||||
|
table[NK_COLOR_WINDOW] = nk_rgba(175, 175, 175, 255);
|
||||||
|
table[NK_COLOR_HEADER] = nk_rgba(175, 175, 175, 255);
|
||||||
|
table[NK_COLOR_BORDER] = nk_rgba(0, 0, 0, 255);
|
||||||
|
table[NK_COLOR_BUTTON] = nk_rgba(185, 185, 185, 255);
|
||||||
|
table[NK_COLOR_BUTTON_HOVER] = nk_rgba(170, 170, 170, 255);
|
||||||
|
table[NK_COLOR_BUTTON_ACTIVE] = nk_rgba(160, 160, 160, 255);
|
||||||
|
table[NK_COLOR_TOGGLE] = nk_rgba(150, 150, 150, 255);
|
||||||
|
table[NK_COLOR_TOGGLE_HOVER] = nk_rgba(120, 120, 120, 255);
|
||||||
|
table[NK_COLOR_TOGGLE_CURSOR] = nk_rgba(175, 175, 175, 255);
|
||||||
|
table[NK_COLOR_SELECT] = nk_rgba(190, 190, 190, 255);
|
||||||
|
table[NK_COLOR_SELECT_ACTIVE] = nk_rgba(175, 175, 175, 255);
|
||||||
|
table[NK_COLOR_SLIDER] = nk_rgba(190, 190, 190, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR] = nk_rgba(80, 80, 80, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR_HOVER] = nk_rgba(70, 70, 70, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR_ACTIVE] = nk_rgba(60, 60, 60, 255);
|
||||||
|
table[NK_COLOR_PROPERTY] = nk_rgba(175, 175, 175, 255);
|
||||||
|
table[NK_COLOR_EDIT] = nk_rgba(150, 150, 150, 255);
|
||||||
|
table[NK_COLOR_EDIT_CURSOR] = nk_rgba(0, 0, 0, 255);
|
||||||
|
table[NK_COLOR_COMBO] = nk_rgba(175, 175, 175, 255);
|
||||||
|
table[NK_COLOR_CHART] = nk_rgba(160, 160, 160, 255);
|
||||||
|
table[NK_COLOR_CHART_COLOR] = nk_rgba(45, 45, 45, 255);
|
||||||
|
table[NK_COLOR_CHART_COLOR_HIGHLIGHT] = nk_rgba( 255, 0, 0, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR] = nk_rgba(180, 180, 180, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR] = nk_rgba(140, 140, 140, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR_HOVER] = nk_rgba(150, 150, 150, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE] = nk_rgba(160, 160, 160, 255);
|
||||||
|
table[NK_COLOR_TAB_HEADER] = nk_rgba(180, 180, 180, 255);
|
||||||
|
nk_style_from_table(ctx, table);
|
||||||
|
} else if (theme == THEME_RED) {
|
||||||
|
table[NK_COLOR_TEXT] = nk_rgba(190, 190, 190, 255);
|
||||||
|
table[NK_COLOR_WINDOW] = nk_rgba(30, 33, 40, 215);
|
||||||
|
table[NK_COLOR_HEADER] = nk_rgba(181, 45, 69, 220);
|
||||||
|
table[NK_COLOR_BORDER] = nk_rgba(51, 55, 67, 255);
|
||||||
|
table[NK_COLOR_BUTTON] = nk_rgba(181, 45, 69, 255);
|
||||||
|
table[NK_COLOR_BUTTON_HOVER] = nk_rgba(190, 50, 70, 255);
|
||||||
|
table[NK_COLOR_BUTTON_ACTIVE] = nk_rgba(195, 55, 75, 255);
|
||||||
|
table[NK_COLOR_TOGGLE] = nk_rgba(51, 55, 67, 255);
|
||||||
|
table[NK_COLOR_TOGGLE_HOVER] = nk_rgba(45, 60, 60, 255);
|
||||||
|
table[NK_COLOR_TOGGLE_CURSOR] = nk_rgba(181, 45, 69, 255);
|
||||||
|
table[NK_COLOR_SELECT] = nk_rgba(51, 55, 67, 255);
|
||||||
|
table[NK_COLOR_SELECT_ACTIVE] = nk_rgba(181, 45, 69, 255);
|
||||||
|
table[NK_COLOR_SLIDER] = nk_rgba(51, 55, 67, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR] = nk_rgba(181, 45, 69, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR_HOVER] = nk_rgba(186, 50, 74, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR_ACTIVE] = nk_rgba(191, 55, 79, 255);
|
||||||
|
table[NK_COLOR_PROPERTY] = nk_rgba(51, 55, 67, 255);
|
||||||
|
table[NK_COLOR_EDIT] = nk_rgba(51, 55, 67, 225);
|
||||||
|
table[NK_COLOR_EDIT_CURSOR] = nk_rgba(190, 190, 190, 255);
|
||||||
|
table[NK_COLOR_COMBO] = nk_rgba(51, 55, 67, 255);
|
||||||
|
table[NK_COLOR_CHART] = nk_rgba(51, 55, 67, 255);
|
||||||
|
table[NK_COLOR_CHART_COLOR] = nk_rgba(170, 40, 60, 255);
|
||||||
|
table[NK_COLOR_CHART_COLOR_HIGHLIGHT] = nk_rgba( 255, 0, 0, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR] = nk_rgba(30, 33, 40, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR] = nk_rgba(64, 84, 95, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR_HOVER] = nk_rgba(70, 90, 100, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE] = nk_rgba(75, 95, 105, 255);
|
||||||
|
table[NK_COLOR_TAB_HEADER] = nk_rgba(181, 45, 69, 220);
|
||||||
|
nk_style_from_table(ctx, table);
|
||||||
|
} else if (theme == THEME_BLUE) {
|
||||||
|
table[NK_COLOR_TEXT] = nk_rgba(20, 20, 20, 255);
|
||||||
|
table[NK_COLOR_WINDOW] = nk_rgba(202, 212, 214, 215);
|
||||||
|
table[NK_COLOR_HEADER] = nk_rgba(137, 182, 224, 220);
|
||||||
|
table[NK_COLOR_BORDER] = nk_rgba(140, 159, 173, 255);
|
||||||
|
table[NK_COLOR_BUTTON] = nk_rgba(137, 182, 224, 255);
|
||||||
|
table[NK_COLOR_BUTTON_HOVER] = nk_rgba(142, 187, 229, 255);
|
||||||
|
table[NK_COLOR_BUTTON_ACTIVE] = nk_rgba(147, 192, 234, 255);
|
||||||
|
table[NK_COLOR_TOGGLE] = nk_rgba(177, 210, 210, 255);
|
||||||
|
table[NK_COLOR_TOGGLE_HOVER] = nk_rgba(182, 215, 215, 255);
|
||||||
|
table[NK_COLOR_TOGGLE_CURSOR] = nk_rgba(137, 182, 224, 255);
|
||||||
|
table[NK_COLOR_SELECT] = nk_rgba(177, 210, 210, 255);
|
||||||
|
table[NK_COLOR_SELECT_ACTIVE] = nk_rgba(137, 182, 224, 255);
|
||||||
|
table[NK_COLOR_SLIDER] = nk_rgba(177, 210, 210, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR] = nk_rgba(137, 182, 224, 245);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR_HOVER] = nk_rgba(142, 188, 229, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR_ACTIVE] = nk_rgba(147, 193, 234, 255);
|
||||||
|
table[NK_COLOR_PROPERTY] = nk_rgba(210, 210, 210, 255);
|
||||||
|
table[NK_COLOR_EDIT] = nk_rgba(210, 210, 210, 225);
|
||||||
|
table[NK_COLOR_EDIT_CURSOR] = nk_rgba(20, 20, 20, 255);
|
||||||
|
table[NK_COLOR_COMBO] = nk_rgba(210, 210, 210, 255);
|
||||||
|
table[NK_COLOR_CHART] = nk_rgba(210, 210, 210, 255);
|
||||||
|
table[NK_COLOR_CHART_COLOR] = nk_rgba(137, 182, 224, 255);
|
||||||
|
table[NK_COLOR_CHART_COLOR_HIGHLIGHT] = nk_rgba( 255, 0, 0, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR] = nk_rgba(190, 200, 200, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR] = nk_rgba(64, 84, 95, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR_HOVER] = nk_rgba(70, 90, 100, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE] = nk_rgba(75, 95, 105, 255);
|
||||||
|
table[NK_COLOR_TAB_HEADER] = nk_rgba(156, 193, 220, 255);
|
||||||
|
nk_style_from_table(ctx, table);
|
||||||
|
} else if (theme == THEME_DARK) {
|
||||||
|
table[NK_COLOR_TEXT] = nk_rgba(210, 210, 210, 255);
|
||||||
|
table[NK_COLOR_WINDOW] = nk_rgba(57, 67, 71, 215);
|
||||||
|
table[NK_COLOR_HEADER] = nk_rgba(51, 51, 56, 220);
|
||||||
|
table[NK_COLOR_BORDER] = nk_rgba(46, 46, 46, 255);
|
||||||
|
table[NK_COLOR_BUTTON] = nk_rgba(48, 83, 111, 255);
|
||||||
|
table[NK_COLOR_BUTTON_HOVER] = nk_rgba(58, 93, 121, 255);
|
||||||
|
table[NK_COLOR_BUTTON_ACTIVE] = nk_rgba(63, 98, 126, 255);
|
||||||
|
table[NK_COLOR_TOGGLE] = nk_rgba(50, 58, 61, 255);
|
||||||
|
table[NK_COLOR_TOGGLE_HOVER] = nk_rgba(45, 53, 56, 255);
|
||||||
|
table[NK_COLOR_TOGGLE_CURSOR] = nk_rgba(48, 83, 111, 255);
|
||||||
|
table[NK_COLOR_SELECT] = nk_rgba(57, 67, 61, 255);
|
||||||
|
table[NK_COLOR_SELECT_ACTIVE] = nk_rgba(48, 83, 111, 255);
|
||||||
|
table[NK_COLOR_SLIDER] = nk_rgba(50, 58, 61, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR] = nk_rgba(48, 83, 111, 245);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR_HOVER] = nk_rgba(53, 88, 116, 255);
|
||||||
|
table[NK_COLOR_SLIDER_CURSOR_ACTIVE] = nk_rgba(58, 93, 121, 255);
|
||||||
|
table[NK_COLOR_PROPERTY] = nk_rgba(50, 58, 61, 255);
|
||||||
|
table[NK_COLOR_EDIT] = nk_rgba(50, 58, 61, 225);
|
||||||
|
table[NK_COLOR_EDIT_CURSOR] = nk_rgba(210, 210, 210, 255);
|
||||||
|
table[NK_COLOR_COMBO] = nk_rgba(50, 58, 61, 255);
|
||||||
|
table[NK_COLOR_CHART] = nk_rgba(50, 58, 61, 255);
|
||||||
|
table[NK_COLOR_CHART_COLOR] = nk_rgba(48, 83, 111, 255);
|
||||||
|
table[NK_COLOR_CHART_COLOR_HIGHLIGHT] = nk_rgba(255, 0, 0, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR] = nk_rgba(50, 58, 61, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR] = nk_rgba(48, 83, 111, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR_HOVER] = nk_rgba(53, 88, 116, 255);
|
||||||
|
table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE] = nk_rgba(58, 93, 121, 255);
|
||||||
|
table[NK_COLOR_TAB_HEADER] = nk_rgba(48, 83, 111, 255);
|
||||||
|
nk_style_from_table(ctx, table);
|
||||||
|
} else {
|
||||||
|
nk_style_default(ctx);
|
||||||
|
}
|
||||||
|
}
|
@ -39,12 +39,6 @@ enum
|
|||||||
NK_WND_LAST
|
NK_WND_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
enum nk_menu_theme
|
|
||||||
{
|
|
||||||
THEME_DARK = 0,
|
|
||||||
THEME_LIGHT
|
|
||||||
};
|
|
||||||
|
|
||||||
struct icons {
|
struct icons {
|
||||||
struct nk_image folder;
|
struct nk_image folder;
|
||||||
struct nk_image monitor;
|
struct nk_image monitor;
|
||||||
@ -81,8 +75,6 @@ typedef struct nk_menu_handle
|
|||||||
/* image & theme related variables */
|
/* image & theme related variables */
|
||||||
char assets_directory[PATH_MAX_LENGTH];
|
char assets_directory[PATH_MAX_LENGTH];
|
||||||
struct icons icons;
|
struct icons icons;
|
||||||
enum nk_menu_theme theme;
|
|
||||||
|
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
@ -93,13 +85,14 @@ typedef struct nk_menu_handle
|
|||||||
video_font_raster_block_t list_block;
|
video_font_raster_block_t list_block;
|
||||||
} nk_menu_handle_t;
|
} nk_menu_handle_t;
|
||||||
|
|
||||||
void nk_wnd_shader_parameters(nk_menu_handle_t *zr);
|
void nk_wnd_shader_parameters(nk_menu_handle_t *nk);
|
||||||
void nk_wnd_main(nk_menu_handle_t *zr);
|
void nk_wnd_main(nk_menu_handle_t *nk);
|
||||||
bool nk_wnd_file_picker(nk_menu_handle_t *nk, const char* in, char* out, const char* filter);
|
bool nk_wnd_file_picker(nk_menu_handle_t *nk, const char* in, char* out, const char* filter);
|
||||||
void nk_wnd_settings(nk_menu_handle_t *zr);
|
void nk_wnd_settings(nk_menu_handle_t *nk);
|
||||||
void nk_wnd_set_state(nk_menu_handle_t *zr, const int id,
|
void nk_wnd_set_state(nk_menu_handle_t *nk, const int id,
|
||||||
struct nk_vec2 pos, struct nk_vec2 size);
|
struct nk_vec2 pos, struct nk_vec2 size);
|
||||||
void nk_wnd_get_state(nk_menu_handle_t *zr, const int id,
|
void nk_wnd_get_state(nk_menu_handle_t *nk, const int id,
|
||||||
struct nk_vec2 *pos, struct nk_vec2 *size);
|
struct nk_vec2 *pos, struct nk_vec2 *size);
|
||||||
|
void nk_common_set_style(struct nk_context *ctx, enum theme theme);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
/* RetroArch - A frontend for libretro.
|
||||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||||
* Copyright (C) 2014-2015 - Jean-André Santoni
|
* Copyright (C) 2014-2015 - Jean-André Santoni
|
||||||
* Copyright (C) 2016 - Andrés Suárez
|
* Copyright (C) 2016 - Andrés Suárez
|
||||||
*
|
*
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
* of the GNU General Public License as published by the Free Software Found-
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nk_menu.h"
|
#include "nk_menu.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
#include <lists/string_list.h>
|
#include <lists/string_list.h>
|
||||||
|
|
||||||
#include "../../menu_driver.h"
|
#include "../../menu_driver.h"
|
||||||
#include "../../menu_hash.h"
|
#include "../../menu_hash.h"
|
||||||
|
|
||||||
void nk_wnd_main(nk_menu_handle_t *zr)
|
void nk_wnd_main(nk_menu_handle_t *nk)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
video_shader_ctx_t shader_info;
|
video_shader_ctx_t shader_info;
|
||||||
struct nk_panel layout;
|
struct nk_panel layout;
|
||||||
struct nk_context *ctx = &zr->ctx;
|
struct nk_context *ctx = &nk->ctx;
|
||||||
const int id = NK_WND_MAIN;
|
const int id = NK_WND_MAIN;
|
||||||
|
|
||||||
if (nk_begin(ctx, &layout, "Main", nk_rect(240, 10, 300, 400),
|
if (nk_begin(ctx, &layout, "Main", nk_rect(240, 10, 300, 400),
|
||||||
NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE|
|
NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE|
|
||||||
NK_WINDOW_SCALABLE|NK_WINDOW_BORDER))
|
NK_WINDOW_SCALABLE|NK_WINDOW_BORDER))
|
||||||
{
|
{
|
||||||
nk_layout_row_dynamic(ctx, 30, 1);
|
nk_layout_row_dynamic(ctx, 30, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save position and size to restore after context reset */
|
/* save position and size to restore after context reset */
|
||||||
nk_wnd_set_state(zr, id, nk_window_get_position(ctx), nk_window_get_size(ctx));
|
nk_wnd_set_state(nk, id, nk_window_get_position(ctx), nk_window_get_size(ctx));
|
||||||
nk_end(ctx);
|
nk_end(ctx);
|
||||||
}
|
}
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
/* RetroArch - A frontend for libretro.
|
||||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||||
* Copyright (C) 2014-2015 - Jean-André Santoni
|
* Copyright (C) 2014-2015 - Jean-André Santoni
|
||||||
* Copyright (C) 2016 - Andrés Suárez
|
* Copyright (C) 2016 - Andrés Suárez
|
||||||
*
|
*
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
* of the GNU General Public License as published by the Free Software Found-
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nk_menu.h"
|
#include "nk_menu.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
#include <lists/string_list.h>
|
#include <lists/string_list.h>
|
||||||
|
|
||||||
#include "../../menu_driver.h"
|
#include "../../menu_driver.h"
|
||||||
#include "../../menu_hash.h"
|
#include "../../menu_hash.h"
|
||||||
|
|
||||||
void nk_wnd_settings(nk_menu_handle_t *zr)
|
void nk_wnd_settings(nk_menu_handle_t *nk)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
video_shader_ctx_t shader_info;
|
video_shader_ctx_t shader_info;
|
||||||
struct nk_panel layout;
|
struct nk_panel layout;
|
||||||
struct nk_context *ctx = &zr->ctx;
|
struct nk_context *ctx = &nk->ctx;
|
||||||
const int id = NK_WND_SETTINGS;
|
const int id = NK_WND_SETTINGS;
|
||||||
|
|
||||||
if (nk_begin(ctx, &layout, "Settings", nk_rect(240, 10, 300, 400),
|
if (nk_begin(ctx, &layout, "Settings", nk_rect(240, 10, 300, 400),
|
||||||
NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE|
|
NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE|
|
||||||
NK_WINDOW_SCALABLE|NK_WINDOW_BORDER))
|
NK_WINDOW_SCALABLE|NK_WINDOW_BORDER))
|
||||||
{
|
{
|
||||||
nk_layout_row_dynamic(ctx, 30, 1);
|
nk_layout_row_dynamic(ctx, 30, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save position and size to restore after context reset */
|
/* save position and size to restore after context reset */
|
||||||
nk_wnd_set_state(zr, id, nk_window_get_position(ctx), nk_window_get_size(ctx));
|
nk_wnd_set_state(nk, id, nk_window_get_position(ctx), nk_window_get_size(ctx));
|
||||||
nk_end(ctx);
|
nk_end(ctx);
|
||||||
}
|
}
|
||||||
|
@ -1,72 +1,72 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
/* RetroArch - A frontend for libretro.
|
||||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||||
* Copyright (C) 2014-2015 - Jean-André Santoni
|
* Copyright (C) 2014-2015 - Jean-André Santoni
|
||||||
* Copyright (C) 2016 - Andrés Suárez
|
* Copyright (C) 2016 - Andrés Suárez
|
||||||
*
|
*
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
* of the GNU General Public License as published by the Free Software Found-
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nk_menu.h"
|
#include "nk_menu.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
#include <lists/string_list.h>
|
#include <lists/string_list.h>
|
||||||
|
|
||||||
#include "../../menu_driver.h"
|
#include "../../menu_driver.h"
|
||||||
#include "../../menu_hash.h"
|
#include "../../menu_hash.h"
|
||||||
|
|
||||||
#include "../../../gfx/common/gl_common.h"
|
#include "../../../gfx/common/gl_common.h"
|
||||||
#include "../../../core_info.h"
|
#include "../../../core_info.h"
|
||||||
#include "../../../configuration.h"
|
#include "../../../configuration.h"
|
||||||
#include "../../../retroarch.h"
|
#include "../../../retroarch.h"
|
||||||
|
|
||||||
void nk_wnd_shader_parameters(nk_menu_handle_t *zr)
|
void nk_wnd_shader_parameters(nk_menu_handle_t *nk)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
video_shader_ctx_t shader_info;
|
video_shader_ctx_t shader_info;
|
||||||
struct nk_panel layout;
|
struct nk_panel layout;
|
||||||
struct nk_context *ctx = &zr->ctx;
|
struct nk_context *ctx = &nk->ctx;
|
||||||
const int id = NK_WND_SHADER_PARAMETERS;
|
const int id = NK_WND_SHADER_PARAMETERS;
|
||||||
|
|
||||||
if (nk_begin(ctx, &layout, "Shader Parameters", nk_rect(240, 10, 300, 400),
|
if (nk_begin(ctx, &layout, "Shader Parameters", nk_rect(240, 10, 300, 400),
|
||||||
NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE|
|
NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE|
|
||||||
NK_WINDOW_SCALABLE|NK_WINDOW_BORDER))
|
NK_WINDOW_SCALABLE|NK_WINDOW_BORDER))
|
||||||
{
|
{
|
||||||
nk_layout_row_dynamic(ctx, 30, 1);
|
nk_layout_row_dynamic(ctx, 30, 1);
|
||||||
|
|
||||||
video_shader_driver_get_current_shader(&shader_info);
|
video_shader_driver_get_current_shader(&shader_info);
|
||||||
|
|
||||||
if (shader_info.data)
|
if (shader_info.data)
|
||||||
{
|
{
|
||||||
for (i = 0; i < GFX_MAX_PARAMETERS; i++)
|
for (i = 0; i < GFX_MAX_PARAMETERS; i++)
|
||||||
{
|
{
|
||||||
if (!string_is_empty(shader_info.data->parameters[i].desc))
|
if (!string_is_empty(shader_info.data->parameters[i].desc))
|
||||||
{
|
{
|
||||||
nk_property_float(ctx, shader_info.data->parameters[i].desc,
|
nk_property_float(ctx, shader_info.data->parameters[i].desc,
|
||||||
shader_info.data->parameters[i].minimum,
|
shader_info.data->parameters[i].minimum,
|
||||||
&(shader_info.data->parameters[i].current),
|
&(shader_info.data->parameters[i].current),
|
||||||
shader_info.data->parameters[i].maximum,
|
shader_info.data->parameters[i].maximum,
|
||||||
shader_info.data->parameters[i].step, 1);
|
shader_info.data->parameters[i].step, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save position and size to restore after context reset */
|
/* save position and size to restore after context reset */
|
||||||
nk_wnd_set_state(zr, id, nk_window_get_position(ctx), nk_window_get_size(ctx));
|
nk_wnd_set_state(nk, id, nk_window_get_position(ctx), nk_window_get_size(ctx));
|
||||||
nk_end(ctx);
|
nk_end(ctx);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user