Minor improvements to Pipeline and Window
This commit is contained in:
@@ -63,6 +63,11 @@ namespace Copium
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
}
|
||||
|
||||
bool Window::IsMouseGrabbed() const
|
||||
{
|
||||
return glfwGetInputMode(window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED;
|
||||
}
|
||||
|
||||
void Window::InitializeWindow(const std::string& windowName, int width, int height, WindowMode mode)
|
||||
{
|
||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace Copium
|
||||
GLFWwindow* GetWindow();
|
||||
|
||||
void GrabMouse(bool grap);
|
||||
bool IsMouseGrabbed() const;
|
||||
|
||||
private:
|
||||
void InitializeWindow(const std::string& windowName, int width, int height, WindowMode mode);
|
||||
|
||||
@@ -97,6 +97,20 @@ namespace Copium
|
||||
return std::make_unique<DescriptorSet>(descriptorPool, descriptorSetLayouts[setIndex], bindings);
|
||||
}
|
||||
|
||||
// TODO: Attempt to move implementation to only use this instead
|
||||
DescriptorSet Pipeline::CreateDescriptorSetRef(DescriptorPool& descriptorPool, int setIndex) const
|
||||
{
|
||||
std::set<ShaderBinding> bindings;
|
||||
for (auto& binding : shaderReflector.bindings)
|
||||
{
|
||||
if (binding.set != setIndex)
|
||||
continue;
|
||||
bindings.emplace(binding);
|
||||
}
|
||||
|
||||
return DescriptorSet{descriptorPool, descriptorSetLayouts[setIndex], bindings};
|
||||
}
|
||||
|
||||
void Pipeline::InitializeDescriptorSetLayout(const PipelineCreator& creator)
|
||||
{
|
||||
boundDescriptorSets.resize(creator.descriptorSetLayouts.size());
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Copium
|
||||
void BindDescriptorSets(const CommandBuffer& commandBuffer);
|
||||
|
||||
std::unique_ptr<DescriptorSet> CreateDescriptorSet(DescriptorPool& descriptorPool, int setIndex) const;
|
||||
DescriptorSet CreateDescriptorSetRef(DescriptorPool& descriptorPool, int setIndex) const;
|
||||
|
||||
private:
|
||||
void InitializeDescriptorSetLayout(const PipelineCreator& creator);
|
||||
|
||||
Reference in New Issue
Block a user