FWindowGLFW¶
-
namespace
marengine -
class
FWindowGLFW: public FWindow¶ - #include “Window/GLFW/WindowGLFW.h”
FWindowGLFW class is second implementation of IWindow. It is basic implementation of GLFW library and gives basic functions.
Subclassed by FWindowGLFWImGui
Public Functions
-
bool
open(uint32_t width, uint32_t height, const char *name) final¶ Method is responsible for opening window with given width, height and its name.
- Return
True if window opened correctly, false otherwise
- Parameters
width: width of windowheight: height of windowname: name of window, that shall be displayed
-
void
close() final¶ Closes current window instance. Remember, it does not terminate library, closes window!
-
bool
initializeLibrary() final¶ Initializes implementation library of window instance. It is called during MAREngine’s startup.
- Return
True if window’s library initialized correctly, false otherwise
-
bool
isGoingToClose() final¶ Checks if window is going to close after that frame and returns the result.
- Return
True, if window is going to close, false otherwise
-
void
setVerticalSync(int32_t vsSetValue) final¶ Sets vertical synchronization (decreases FPS if set on!).
- Parameters
vsSetValue: vsSetValue equal to 1 sets VS. 0 disables it.
-
void
clear() const final¶ Clears screen.
-
void
swapBuffers() final¶ Swaps buffers and polls event.
-
bool
isKeyPressed(int32_t key) const final¶ Checks, if given key at keyboard was pressed and returns result. For correct key value check Window/buttons_def.h file.
- Return
True, if keyboard key was pressed, false otherwise.
- Parameters
key: Keyboard value, to be checked if it was pressed.
-
bool
isMousePressed(int32_t key) const final¶ Checks, if given key at mouse was pressed and returns result. For correct key value check Window/buttons_def.h file.
- Return
True, if mouse key was pressed, false otherwise.
- Parameters
key: Mouse value, to be checked if it was pressed.
Protected Attributes
-
GLFWwindow *
p_pWindowContext= {nullptr}¶
-
bool
-
class
FWindowGLFWImGui: public FWindowGLFW¶ - #include “Window/GLFW/WindowGLFW.h”
FWindowGLFWImGui class is third implementation of IWindow. It derives from FWindowGLFW implementation and updates mandatory methods for editor.
Public Functions
-
void
initEditorGuiLibrary() final¶ Initializes GUI Editor Library with window instance, so that it can be used correctly. It is called during editor gui initialization.
-
void
beginNewFrameEditorGuiLibrary() final¶ Begins new frame at editor GUI library. Called during every new frame.
-
void
terminateEditorGuiLibrary() final¶ Terminates EditorGUI library, so that window afterwards can be closed correctly.
-
void
-
class