|
JMgui
|
#include <JMgui.h>
Public Member Functions | |
| JMwindow (int width, int height, const char *title) | |
| initializes the window with a specified size. | |
| JMwindow (const char *title) | |
| initializes the window maximized. | |
| JMwindow (JMwindow &)=delete | |
| JMwindow & | operator= (const JMwindow &)=delete |
| JMwindow (JMwindow &&)=default | |
| JMwindow & | operator= (JMwindow &&)=default |
| void | useCustomTitleBar () |
| call once after initializing to use a custom, themed title bar. | |
| void | setResizable (bool isResizable) |
| pass whether or not the window should be resizable | |
| void | setWindowIcon (const char *filePath) |
| sets the window icon displayed on the title bar to a custom image | |
| void | loadFont (const char *filePath) |
| loads in a new font to use for the window and gui | |
| void | beginDraw () |
| call once each frame at the start of the graphics loop. | |
| void | endDraw () |
| call once each frame at the end of the graphics loop. | |
| float | width () const |
| returns the width of the window in pixels. | |
| float | height () const |
| returns the height of the window in pixels. | |
| void | maximize () |
| void | minimize () |
| void | windowMode () |
| bool | mouseInRect (float x1, float x2, float y1, float y2) const |
| returns true is the mouse is inside a specified rectangle. | |
| bool | coordInRect (float X, float Y, float posX, float posY, float sizeX, float sizeY) const |
| returns true of the input coordinates are inside a rectangle centered on posX, posY. | |
| void | renderProgressBar (float posX, float posY, float width, float percentage, std::string title) const |
| renders a progress bar at the specified coordinates with the input percentage. | |
| void | renderProgressBar (float posX, float posY, float width, float percentage) const |
| renders a progress bar at the specified coordinates with the input percentage. | |
| std::string | loadFileDialog () const |
| Opens a file explorer window and returns the user selected file path. | |
| std::string | saveFileDialog () const |
| Opens a file explorer window and returns the user created file path. | |
| std::string | loadFileDialog (std::string ext) const |
| Opens a file explorer window and returns the user selected file path. Only shows parameter file type. | |
| std::string | saveFileDialog (std::string ext) const |
| Opens a file explorer window and returns the user created file path. Saves as parameter file type. | |
Public Attributes | |
| JMGraphics * | window |
| JMGraphics::Font * | font_standard |
| JMGraphics::Font * | font_large |
| JMGraphics::Font * | font_small |
| glm::vec4 | color_titleBar = glm::vec4(0.1f, 0.1f, 0.12f, 0.8f) |
| glm::vec4 | color_background1 = glm::vec4(0.2f, 0.23f, 0.4f, 1.0f) |
| glm::vec4 | color_background2 = glm::vec4(0.0f, 0.1f, 0.3f, 0.8f) |
| glm::vec4 | color_fill1 = glm::vec4(0.5f, 0.55f, 0.7f, 0.75f) |
| glm::vec4 | color_fill2 = glm::vec4(0.2f, 0.3f, 0.9f, 1.0f) |
| glm::vec4 | color_activeObject = glm::vec4(1.0f, 0.1f, 0.0f, 1.0f) |
| glm::vec4 | color_lines1 = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f) |
| glm::vec4 | color_lines2 = glm::vec4(0.2, 0.22f, 0.3f, 1.0f) |
| glm::vec4 | color_clear = glm::vec4(0.0f, 0.0f, 0.0f, 0.0f) |
| bool | animatedStartup = true |
| If true, GUI elements will show a startup animation when displayed for the first time. | |
| float | titleBarWidth = 30.0f |
| The thickness of the title bar if useCustomTitleBar() was called. | |
| JMeventDispatcher * | eventDispatcher = nullptr |
| JMGraphics::Buffer * | backgroundImage = nullptr |
| draw to this buffer if you want a specific image to be used as a background | |
| GLFWcursor * | cursor_default = nullptr |
| GLFWcursor * | cursor_windowResizeH = nullptr |
| GLFWcursor * | cursor_windowResizeV = nullptr |
| GLFWcursor * | cursor_ibeam = nullptr |
| GLFWcursor * | cursor_crosshair = nullptr |
Creates and manages a window. Contains a JMGraphics object called "window" that can be used to generate graphics. Also contains an event dispatcher and gui properties so functional user interface elements can be attached like GuiElementHandler.