gl-render: knocking on frame buffer object

git-svn-id: svn://kolibrios.org@4472 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge)
2014-01-17 15:35:36 +00:00
parent c5b31b6cb2
commit cfb22e3303
2 changed files with 106 additions and 15 deletions

View File

@@ -3,12 +3,14 @@
#include <string.h>
#include <math.h>
#define EGL_EGLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glu.h>
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
#include "EGL/egl.h"
#include "EGL/eglext.h"
#include "GL/gl.h"
#include "gbm.h"
#include <kos32sys.h>
#include "eglut.h"
@@ -48,7 +50,7 @@ idle(void)
static void reshape(int width, int height)
{
asm volatile ("int3");
/*
glViewport(0, 0, (GLint)width, (GLint)height);
@@ -58,10 +60,11 @@ static void reshape(int width, int height)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
*/
glViewport(0, 0, (GLint) width, (GLint) height);
GLfloat h = (GLfloat) height / (GLfloat) width;
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
@@ -102,12 +105,13 @@ main(int argc, char *argv[])
eglutReshapeFunc(reshape);
eglutDisplayFunc(draw);
glClearColor( 0, 0, 0, 1.0);
glClearColor( 0, 0, 0, 1);
init();
// init();
glDrawBuffer(GL_BACK);
eglutMainLoop();
return 0;
}