struct Attributes
{
// OpenGL attributes
- long colorBuffer[4]; // rgba
- long frameBuffer;
- bool doubleBuffer;
- long depthBuffer;
- long stencilBuffer;
- long accumBuffer[4]; // rgba
- bool stereo;
- long multisampleBuffers;
- long multisampleSamples;
- bool swapControl;
- bool hardwareonly;
+ long colorBuffer[4]; // rgba
+ long frameBuffer;
+ bool doubleBuffer;
+ long depthBuffer;
+ long stencilBuffer;
+ long accumBuffer[4]; // rgba
+ bool stereo;
+ long multisampleBuffers;
+ long multisampleSamples;
+ bool swapControl;
+ bool hardwareonly;
// Window attributes
- long mode[3]; // width, height, bpp
- bool fullscreen;
- bool resizable;
- bool cursorVisible;
- bool cursorGrab;
+ std::string caption;
+ std::string icon;
+ long mode[3]; // width, height, bpp
+ bool fullscreen;
+ bool resizable;
+ bool cursorVisible;
+ bool cursorGrab;
Attributes();
};
Video();
- Video(const Attributes& attribs);
- Video(const Attributes& attribs, const std::string& caption);
- Video(const std::string& caption);
+ explicit Video(const Attributes& attribs);
+ explicit Video(const std::string& caption, const std::string& icon);
~Video();
void setVideoMode(const long mode[3]);
};
private:
- void init(const Attributes& attribs, const std::string& caption);
+ void init(const Attributes& attribs);
+
void recreateContext();
void setOpenGLAttributes();
+ void setIcon();
+
SDL_Surface* context_;
unsigned flags_;
Attributes attribs_;