1
0
Fork 0

GLContext: Remove bpp parameter from create()

Hardcode to 32 bits for now.
This commit is contained in:
Henrik Hautakoski 2016-02-17 13:28:17 +01:00
parent 8675018522
commit 2da2601149
4 changed files with 11 additions and 11 deletions

View file

@ -16,7 +16,7 @@ public :
virtual ~GLContext();
// Create a GLContext for this perticular display.
virtual bool create(const PlatformDisplay* display, unsigned int bpp) = 0;
virtual bool create(const PlatformDisplay* display) = 0;
virtual void destroy() = 0;

View file

@ -31,7 +31,7 @@ bool Display::create(DisplayDescription description)
return false;
}
if (!m_context->create(m_impl, description.mode.bpp)) {
if (!m_context->create(m_impl)) {
return false;
}

View file

@ -36,7 +36,7 @@ Win32GLContext::~Win32GLContext()
destroy();
}
bool Win32GLContext::create(const PlatformDisplay* display, unsigned int bpp)
bool Win32GLContext::create(const PlatformDisplay* display)
{
// If created. destroy old handles.
destroy();
@ -51,7 +51,7 @@ bool Win32GLContext::create(const PlatformDisplay* display, unsigned int bpp)
m_deviceContext = ::GetDC(m_wnd);
createGLContext(bpp);
createGLContext();
if (!m_deviceContext || !m_renderContext) {
@ -78,10 +78,10 @@ void Win32GLContext::destroy()
}
}
void Win32GLContext::createGLContext(unsigned int bpp)
void Win32GLContext::createGLContext()
{
// First set pixel format.
if (!setPixelFormat(bpp)) {
if (!setPixelFormat()) {
return;
}
@ -132,7 +132,7 @@ void Win32GLContext::swapBuffers()
}
}
bool Win32GLContext::setPixelFormat(unsigned int bpp)
bool Win32GLContext::setPixelFormat()
{
PIXELFORMATDESCRIPTOR pfd;
int format;
@ -144,7 +144,7 @@ bool Win32GLContext::setPixelFormat(unsigned int bpp)
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = bpp;
pfd.cColorBits = 32;
pfd.cDepthBits = 16;
pfd.iLayerType = PFD_MAIN_PLANE;

View file

@ -14,7 +14,7 @@ public :
~Win32GLContext();
// Create a context associated with a display.
bool create(const PlatformDisplay* display, unsigned int bpp);
bool create(const PlatformDisplay* display);
void destroy();
@ -34,9 +34,9 @@ public :
private :
void createGLContext(unsigned int bpp);
void createGLContext();
bool setPixelFormat(unsigned int bpp);
bool setPixelFormat();
private :