Answer the question
In order to leave comments, you need to log in
Member with constructor not allowed in anonymous aggregate?
Weird error:
member 'IWindowSystem ::' with copy assignment operator not allowed in anonymous aggregate
class GLFW : IWindowSystem
-------------^-------------- ------
WindowSystem.cpp:
#include <WindowSystem.hpp>
#include <stddef.h>
#define GLFW
#ifdef GLFW
#include <GLFW/glfw3.h>
class GLFWWin : public IWindow
{
private:
void (*CallBack)(IWindow *, int, int);
GLFWwindow *window;
public:
void static WindowResizeCallBack(GLFWwindow* window, int width, int height) {
}
GLFWWin(GLFWwindow *window)
{
this->window = window;
}
virtual void *getLowLevelInfo()
{
return window;
}
virtual void setWindowResizeCallBack(void (*CallBack)(IWindow *, int, int))
{
this->CallBack = CallBack;
glfwSetFramebufferSizeCallback(window, GLFWWin::WindowResizeCallBack);
}
};
class GLFW : public IWindowSystem
{
public:
virtual void initWindowSystem()
{
glfwInit();
}
virtual IWindow *createWindow(const char *title, int width, int height)
{
return (IWindow *)new GLFWWin(glfwCreateWindow(width, height, title, NULL, NULL));
}
virtual IWindow *createFullScreenWindow(const char *title)
{
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
const GLFWvidmode *mode = glfwGetVideoMode(monitor);
return new GLFWWin(glfwCreateWindow(mode->width, mode->height, title, monitor, NULL));
}
};
#endif
class IWindow
{
public:
virtual void *getLowLevelInfo() = 0;
virtual void setWindowResizeCallBack(void (*CallBack)(IWindow *, int, int)) = 0;
};
class IWindowSystem
{
public:
virtual void initWindowSystem() = 0;
virtual IWindow *createWindow(char **title, int width, int height) = 0;
virtual IWindow *createFullScreenWindow(char **title) = 0;
};
Answer the question
In order to leave comments, you need to log in
one)
#define GLFW
#ifdef GLFW
class GLFW : public IWindowSystem
-> class : public IWindowSystem {}
virtual IWindow *createFullScreenWindow(char **title) = 0;
-> virtual IWindow *createFullScreenWindow(const char *title) {}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question