SpiecsEngine
 
Loading...
Searching...
No Matches

◆ VulkanWindows()

Spices::VulkanWindows::VulkanWindows ( VulkanState & vulkanState,
const WindowInfo & initInfo )

Constructor Function. Create Windows.

Parameters
[in]vulkanStateThe global VulkanState.
[in]initInfoWindowInfo.

glfw initialize.

Create glfwWindow. Display in Main monitor.

Set glfwWindow Icon.

Set glfw call back object pointer.

Set all needed GLFW events call back.

glfw initialize.

Create glfwWindow. Display in Main monitor.

Set glfwWindow Icon.

Set glfw call back object pointer.

Set all needed GLFW events call back.

Definition at line 16 of file VulkanWindows.cpp.

17 : VulkanObject(vulkanState), m_WindowInfo(initInfo)
18 {
20
24 glfwInit();
25
26 glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); /* @brief Set glfw not use OpenGl api. */
27 glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); /* @brief Set glfw enable resize feature. */
28 glfwWindowHint(GLFW_DECORATED, GLFW_TRUE); /* @brief Set glfw enable title tab. */
29
30 const GLFWvidmode* mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
31
32 glfwWindowHint(GLFW_RED_BITS , mode->redBits );
33 glfwWindowHint(GLFW_GREEN_BITS , mode->greenBits );
34 glfwWindowHint(GLFW_BLUE_BITS , mode->blueBits );
35 glfwWindowHint(GLFW_REFRESH_RATE , mode->refreshRate );
36
41 vulkanState.m_Windows = glfwCreateWindow(initInfo.width, initInfo.height, initInfo.name.c_str(), nullptr, nullptr);
42
46 glfwSetWindowIcon(vulkanState.m_Windows, 1, &initInfo.icon->image);
47
48 /*HWND hwndGLFW = glfwGetWin32Window(vulkanState.m_Windows);
49 LONG ret = ::GetWindowLong(hwndGLFW, GWL_EXSTYLE);
50 ret = ret | WS_EX_LAYERED;
51 ::SetWindowLong(hwndGLFW, GWL_EXSTYLE, ret);
52 ::SetLayeredWindowAttributes(hwndGLFW, RGB(255, 0, 0), 255, LWA_COLORKEY | LWA_ALPHA);*/
53
57 glfwSetWindowUserPointer(vulkanState.m_Windows, this);
58
63 }
#define SPICES_PROFILE_ZONE
VulkanObject(VulkanState &vulkanState)
Constructor Function. Init member variables.
void SetInternalCallBack() const
Set all needed GLFW events call back.
WindowInfo m_WindowInfo
Window's info. not viewport's info.
const WindowInfo initInfo
Window create parameter.
std::shared_ptr< WindowIcon > icon
Window's icon.
std::string name
Window's name.
int width
Window's width.
int height
Window's height.

References Spices::WindowInfo::height, Spices::WindowInfo::name, SetInternalCallBack(), Spices::VulkanObject::VulkanObject(), VulkanWindows(), and Spices::WindowInfo::width.

Referenced by VulkanWindows().