Some opengl additions
This commit is contained in:
parent
72123bc333
commit
649079a5c7
6 changed files with 163 additions and 17 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "XcbGlInterface.h"
|
||||
|
||||
#include "FileLogger.h"
|
||||
#include <iostream>
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
@ -59,6 +60,7 @@ void XcbGlInterface::setupContext(int default_screen)
|
|||
glXGetFBConfigAttrib(mDisplay, mConfig, GLX_VISUAL_ID, &visualID);
|
||||
|
||||
/* Create OpenGL context */
|
||||
std::cout << "Creating opengl context" << std::endl;
|
||||
mContext = glXCreateNewContext(mDisplay, mConfig, GLX_RGBA_TYPE, 0, True);
|
||||
if (!mContext)
|
||||
{
|
||||
|
|
|
@ -54,17 +54,18 @@ bool XcbGlWindowInterface::initialize(xcb_window_t window)
|
|||
MLOG_ERROR("glXMakeContextCurrent failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void XcbGlWindowInterface::resizeViewPort(unsigned width, unsigned height)
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
glScissor(0, 0, width, height);
|
||||
//glViewport(0, 0, width, height);
|
||||
//glScissor(0, 0, width, height);
|
||||
|
||||
glOrtho(0, width, 0, height, -1.0, 1.0);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
//glOrtho(0, width, 0, height, -1.0, 1.0);
|
||||
//glMatrixMode(GL_PROJECTION);
|
||||
//glLoadIdentity();
|
||||
|
||||
//glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue