18 class MANDRILL_API
App
27 App(
const std::string& title, uint32_t width = 1280, uint32_t height = 720);
60 virtual void update(
float delta) = 0;
101 virtual void appGUI(ImGuiContext* pContext) = 0;
112 void createGUI(ptr<Device> pDevice, ptr<Pass> pPass);
120 void destroyGUI(ptr<Device> pDevice);
132 void baseGUI(ptr<Device> pDevice, ptr<Swapchain> pSwapchain, ptr<Pipeline> pPipeline);
144 void baseGUI(ptr<Device> pDevice, ptr<Swapchain> pSwapchain, std::vector<ptr<Pipeline>> pPipelines);
152 void renderGUI(VkCommandBuffer cmd)
const;
166 void baseKeyCallback(GLFWwindow* pWindow,
int key,
int scancode,
int action,
int mods, ptr<Device> pDevice,
167 ptr<Swapchain> pSwapchain, ptr<Pipeline> pPipeline);
181 void baseKeyCallback(GLFWwindow* pWindow,
int key,
int scancode,
int action,
int mods, ptr<Device> pDevice,
182 ptr<Swapchain> pSwapchain, std::vector<ptr<Pipeline>> pPipelines);
193 virtual void appKeyCallback(GLFWwindow* pWindow,
int key,
int scancode,
int action,
int mods) = 0;
203 void baseCursorPosCallback(GLFWwindow* pWindow,
double xPos,
double yPos);
223 void baseMouseButtonCallback(GLFWwindow* pWindow,
int button,
int action,
int mods, ptr<Camera> pCamera);
241 return {mCursorDeltaX, mCursorDeltaY};
250 return mKeyboardCapturedByGUI;
259 return mMouseCapturedByGUI;
263 GLFWwindow* mpWindow;
267 uint32_t mWidth, mHeight;
281 void initGLFW(
const std::string& title, uint32_t width, uint32_t height);
294 ImGuiContext* newFrameGUI();
300 void takeScreenshot(ptr<Swapchain> pSwapchain);
305 void toggleFullscreen();
310 void resetFramebufferSize();
320 static void keyCallbackEntry(GLFWwindow* pWindow,
int key,
int scancode,
int action,
int mods);
328 static void cursorPosCallbackEntry(GLFWwindow* pWindow,
double xPos,
double yPos);
337 static void mouseButtonCallbackEntry(GLFWwindow* pWindow,
int button,
int action,
int mods);
343 float mDeltaSmooth = 0.0f;
346 const float kSmoothingFactor = 0.05f;
349 GLFWmonitor* mpMonitor;
350 GLFWvidmode mFullscreenMode;
351 bool mFullscreen =
false;
354 float mCursorX = 0.0f, mCursorY = 0.0f;
355 float mCursorDeltaX = 0.0f, mCursorDeltaY = 0.0f;
356 float mCursorPrevX = 0.0f, mCursorPrevY = 0.0f;
359 bool mCreatedGUI =
false;
360 bool mShowMainMenu =
true;
361 bool mShowFrameRate =
false;
362 bool mShowHelp =
false;
363 bool mShowAbout =
false;
366 bool mKeyboardCapturedByGUI;
367 bool mMouseCapturedByGUI;
370 VkDescriptorPool mDescriptorPool;
virtual void appMouseButtonCallback(GLFWwindow *pWindow, int button, int action, int mods)=0
Virtual function for app to override. Just invoke baseMouseButtonCallback() to get standard keybindin...
virtual void appCursorPosCallback(GLFWwindow *pWindow, double xPos, double yPos)=0
Virtual function for app to override. Just invoke baseCursorPosCallback() to get standard keybindings...
virtual void appKeyCallback(GLFWwindow *pWindow, int key, int scancode, int action, int mods)=0
Virtual function for app to override. Just invoke baseKeyCallback() to get standard keybindings....