Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4526 → Rev 4525

/contrib/sdk/sources/render/render.c
340,15 → 340,6
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float),render->tc_src);
glEnableVertexAttribArray(1);
 
render->tc_src[0] = 0.0;
render->tc_src[1] = 0.0;
render->tc_src[1*2] = 1.0;
render->tc_src[1*2+1]= 0.0;
render->tc_src[2*2] = 1.0;
render->tc_src[2*2+1]= 1.0;
render->tc_src[3*2] = 0.0;
render->tc_src[3*2+1]= 1.0;
 
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
 
/contrib/sdk/sources/render/swap.c
6,9 → 6,6
#include <i915_drm.h>
#include <kos32sys.h>
 
#define WIN_STATE_MINIMIZED 0x02
#define WIN_STATE_ROLLED 0x04
 
static int drm_ioctl(int fd, unsigned long request, void *arg)
{
ioctl_t io;
30,8 → 27,8
 
EGLContext context;
EGLSurface draw, read;
uint32_t winx, winy, winw, winh;
uint8_t state;
int winx, winy, winw, winh;
 
float xscale, yscale;
float *vertices = render->vertices;
float *texcoords = render->tc_src;
46,11 → 43,7
winy = *(uint32_t*)(proc_info+38);
winw = *(uint32_t*)(proc_info+42)+1;
winh = *(uint32_t*)(proc_info+46)+1;
state = *(uint8_t*)(proc_info+70);
 
if(state & (WIN_STATE_MINIMIZED|WIN_STATE_ROLLED))
return;
 
context = eglGetCurrentContext();
draw = eglGetCurrentSurface(EGL_DRAW);
read = eglGetCurrentSurface(EGL_READ);
71,6 → 64,7
if(drm_ioctl(render->fd, 45, &update))
return;
 
 
if (!eglMakeCurrent(render->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, render->context))
{
printf("failed to make window current");
77,9 → 71,17
goto err1;
};
 
 
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, render->tx_buffers[render->back_buffer]);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,
GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MAG_FILTER,
GL_NEAREST);
 
 
xscale = 1.0/render->scr_width;
yscale = 1.0/render->scr_height;
 
99,9 → 101,24
vertices[1*2+1] = t1;
vertices[3*2+1] = t5;
 
texcoords[0] = 0.0;
texcoords[1] = 0.0;
texcoords[1*2] = 1.0;
texcoords[1*2+1]= 0.0;
texcoords[2*2] = 1.0;
texcoords[2*2+1]= 1.0;
texcoords[3*2] = 0.0;
texcoords[3*2+1]= 1.0;
 
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
// glFlush();
glFlush();
 
// glDisableVertexAttribArray(0);
// glDisableVertexAttribArray(1);
// glDisable(GL_TEXTURE_2D);
// glUseProgram(0);
 
 
err1:
eglMakeCurrent(render->dpy, draw, read, context);
}