2024-10-30 01:53:17 +00:00
|
|
|
#ifndef SHROOMS_VB_NATIVE_WINDOW_
|
|
|
|
#define SHROOMS_VB_NATIVE_WINDOW_
|
|
|
|
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
#include "nuklear.h"
|
|
|
|
|
|
|
|
typedef struct WindowContext {
|
|
|
|
SDL_Window *window;
|
2024-11-01 03:40:40 +00:00
|
|
|
float screenSizeMultiplier;
|
2024-11-01 01:11:13 +00:00
|
|
|
float screenScaleX, screenScaleY;
|
2024-10-30 01:53:17 +00:00
|
|
|
SDL_Renderer *renderer;
|
|
|
|
SDL_Texture *leftEye;
|
|
|
|
SDL_Texture *rightEye;
|
|
|
|
struct nk_context *nk;
|
|
|
|
struct nk_font *font;
|
|
|
|
} WindowContext;
|
|
|
|
|
|
|
|
int windowInit(WindowContext *win, const char *title);
|
|
|
|
void windowDestroy(WindowContext *win);
|
|
|
|
|
2024-11-01 03:40:40 +00:00
|
|
|
float windowGetScreenSizeMultiplier(WindowContext *win);
|
|
|
|
void windowSetScreenSizeMultiplier(WindowContext *win, float multiplier);
|
2024-10-30 01:53:17 +00:00
|
|
|
void windowUpdate(WindowContext *win, const uint8_t *left, const uint8_t *right);
|
|
|
|
|
2024-11-01 01:11:13 +00:00
|
|
|
int windowScaleX(WindowContext *win, int x);
|
|
|
|
int windowScaleY(WindowContext *win, int y);
|
|
|
|
int windowGetMenuHeight(WindowContext *win);
|
2024-10-30 01:53:17 +00:00
|
|
|
int windowGetScreenHeight(WindowContext *win);
|
|
|
|
|
|
|
|
void windowDisplayBegin(WindowContext *win);
|
|
|
|
void windowDisplayEnd(WindowContext *win);
|
|
|
|
bool windowGuiBegin(WindowContext *win, const char *title);
|
|
|
|
void windowGuiEnd(WindowContext *win);
|
|
|
|
void windowMenubarBegin(WindowContext *win, const char **items);
|
|
|
|
void windowMenubarEnd(WindowContext *win);
|
2024-11-01 04:52:27 +00:00
|
|
|
bool windowMenuBegin(WindowContext *win, const char *label, int width);
|
|
|
|
void windowMenuEnd(WindowContext *win);
|
|
|
|
bool windowMenuItemLabel(WindowContext *win, const char *label);
|
|
|
|
bool windowMenuItemLabelChecked(WindowContext *win, const char *label, bool checked);
|
2024-10-30 01:53:17 +00:00
|
|
|
|
|
|
|
#endif
|