need help understanding this function,
void Window::Create(){
auto style = (m_isFullscreen ? sf::Style::Fullscreen: sf::Style::Default);
m_window.create({ m_windowSize.x, m_windowSize.y, 32 }, m_windowTitle, style);
}
I understand that the create function is used like this
m_window.create( sf::VideoMode(800, 600), "mywindow", style);
so how come there are three variables in the parameter enclosed with a curly brace?
the string m_windowTitle and style are there, but what is with the first parameters enclosed with the curly brace,
what is the 32 and what is it used for?
here is the rest of the code I condensed from the book
#include "Window.h"
Window::Window()
{
Setup("test", sf::Vector2u(800,600));
}
Window::Window(const std::string& title,sf::Vector2u size)
{
Setup(title, size);
}
void Window::Setup(const std::string& title,sf::Vector2u size)
{
m_isDone = false;
m_isFullscreen = false;
m_windowSize = size;
m_windowTitle = title;
Create();
}
Window::~Window()
{
}
bool Window::IsDone()
{
return m_isDone;
}
sf::RenderWindow * Window::GetRenderWindow()
{
return &m_window;
}
void Window::BeginWindow()
{
m_window.clear(sf::Color::Black);
}
void Window::EndWindow()
{
m_window.display();
}
void Window::Create()
{
auto style = (m_isFullscreen ? sf::Style::Fullscreen : sf::Style::Default);
//m_window.create({ m_windowSize.x, m_windowSize.y, 32}, m_windowTitle, style);
m_window.create( sf::VideoMode(800, 600), "mywindow", style);
}
void Window::Update()
{
sf::Event event;
while (m_window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
m_window.close();
}
}