Странная ошибка:
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
WindowSystem.hpp:
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;
};