Nebula
Loading...
Searching...
No Matches
glfwwindow.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
10#include "GLFW/glfw3.h"
11#include "util/fixedarray.h"
12#include "coregraphics/window.h"
15#include "ids/idallocator.h"
16
17namespace CoreGraphics
18{
19
21{
23 bool done : 1;
24 bool vsync : 1;
25};
26
27enum
28{
35};
36
37typedef Ids::IdAllocator<
38 GLFWwindow*
40 , IndexT
41 , WindowCreateInfo
42 , ResizeInfo
43 , SwapchainId
46} // namespace CoreGraphics
47
48namespace GLFW
49{
50
52void KeyFunc(const CoreGraphics::WindowId& id, int key, int scancode, int action, int mods);
54void CharFunc(const CoreGraphics::WindowId& id, unsigned int key);
56void MouseButtonFunc(const CoreGraphics::WindowId& id, int button, int action, int mods);
58void MouseFunc(const CoreGraphics::WindowId& id, double xpos, double ypos);
60void ScrollFunc(const CoreGraphics::WindowId& id, double xs, double ys);
62void CloseFunc(const CoreGraphics::WindowId& id);
64void FocusFunc(const CoreGraphics::WindowId& id, int focus);
66void ResizeFunc(const CoreGraphics::WindowId& id, int width, int height);
67
69void staticKeyFunc(GLFWwindow *window, int key, int scancode, int action, int mods);
71void staticMouseButtonFunc(GLFWwindow *window, int button, int action, int mods);
73void staticMouseFunc(GLFWwindow *window, double xpos, double ypos);
75void staticScrollFunc(GLFWwindow *window, double xs, double ys);
77void staticCloseFunc(GLFWwindow * window);
79void staticFocusFunc(GLFWwindow * window, int focus);
81void staticSizeFunc(GLFWwindow* window, int width, int height);
83void staticCharFunc(GLFWwindow* window, unsigned int key);
84
89
91const CoreGraphics::WindowId InternalSetupFunction(const CoreGraphics::WindowCreateInfo& info, const Util::Blob& windowData, bool embed);
92
93}
Describe a fullscreen display mode or window dimensions.
Definition displaymode.h:19
An ID allocator associates an id with a slice in an N number of arrays.
Definition idallocator.h:39
The Util::Blob class encapsulates a chunk of raw memory into a C++ object which can be copied,...
Definition blob.h:22
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
Ids::IdAllocator< GLFWwindow *, CoreGraphics::DisplayMode, IndexT, WindowCreateInfo, ResizeInfo, SwapchainId > GLFWWindowAllocatorType
Definition glfwwindow.h:44
GLFWWindowAllocatorType glfwWindowAllocator(0x00FFFFFF)
Definition glfwwindow.h:45
@ GLFW_Swapchain
Definition glfwwindow.h:34
@ GLFW_SwapFrame
Definition glfwwindow.h:31
@ GLFW_ResizeInfo
Definition glfwwindow.h:33
@ GLFW_DisplayMode
Definition glfwwindow.h:30
@ GLFW_SetupInfo
Definition glfwwindow.h:32
@ GLFW_Window
Definition glfwwindow.h:29
Definition glfwinputserver.cc:12
void ResizeFunc(const CoreGraphics::WindowId &id, int width, int height)
window resize
Definition glfwwindow.cc:368
void ScrollFunc(const CoreGraphics::WindowId &id, double xs, double ys)
Scroll callback.
Definition glfwwindow.cc:155
void staticMouseButtonFunc(GLFWwindow *window, int button, int action, int mods)
declare static mouse button function as friend
void KeyFunc(const CoreGraphics::WindowId &id, int key, int scancode, int action, int mods)
Keyboard callback.
Definition glfwwindow.cc:74
void CharFunc(const CoreGraphics::WindowId &id, unsigned int key)
Character callback.
Definition glfwwindow.cc:100
void DisableCallbacks(const CoreGraphics::WindowId &id)
disables callbacks
Definition glfwwindow.cc:245
void staticKeyFunc(GLFWwindow *window, int key, int scancode, int action, int mods)
declare static key function as friend
void CloseFunc(const CoreGraphics::WindowId &id)
window close func
Definition glfwwindow.cc:167
void staticCloseFunc(GLFWwindow *window)
declare static close function as friend
void MouseFunc(const CoreGraphics::WindowId &id, double xpos, double ypos)
Mouse callback.
Definition glfwwindow.cc:142
void staticScrollFunc(GLFWwindow *window, double xs, double ys)
declare static scroll function as friend
void staticMouseFunc(GLFWwindow *window, double xpos, double ypos)
declare static mouse function as friend
void EnableCallbacks(const CoreGraphics::WindowId &id)
enables callbacks
Definition glfwwindow.cc:192
const WindowId InternalSetupFunction(const WindowCreateInfo &info, const Util::Blob &windowData, bool embed)
internal setup function, either does embedding or ordinary opening
Definition glfwwindow.cc:263
void staticFocusFunc(GLFWwindow *window, int focus)
declare static focus function as friend
void MouseButtonFunc(const CoreGraphics::WindowId &id, int button, int action, int mods)
Mouse Button callback.
Definition glfwwindow.cc:109
void staticSizeFunc(GLFWwindow *window, int width, int height)
declare static size function as friend
void FocusFunc(const CoreGraphics::WindowId &id, int focus)
window focus
Definition glfwwindow.cc:176
void staticCharFunc(GLFWwindow *window, unsigned int key)
declare static char function as friend
Definition glfwwindow.h:21
bool vsync
Definition glfwwindow.h:24
uint newHeight
Definition glfwwindow.h:22
uint newWidth
Definition glfwwindow.h:22
bool done
Definition glfwwindow.h:23
Definition window.h:31
Definition window.h:25
unsigned int uint
Definition types.h:31
int IndexT
Definition types.h:48