forked from enlightenment/efl
parent
b4a315b048
commit
5631d58659
|
@ -31,6 +31,7 @@ evas_object.c \
|
|||
evas_rectangle.c \
|
||||
evas_render.c \
|
||||
evas_text.c \
|
||||
evas_gl_routines.h \
|
||||
Evas.h
|
||||
|
||||
libevas_la_LIBADD = -lX11 -lXext -lttf -ldl -lm -lImlib2 -ldb -lGL $(LDFLAGS)
|
||||
|
|
|
@ -1,23 +1,4 @@
|
|||
/* C library header files. */
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glx.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xmu/StdCmap.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#include "Evas.h"
|
||||
|
||||
Display *disp;
|
||||
#include "evas_gl_routines.h"
|
||||
|
||||
static int __evas_gl_configuration[] =
|
||||
{
|
||||
|
@ -29,47 +10,6 @@ static int __evas_gl_configuration[] =
|
|||
None
|
||||
};
|
||||
|
||||
/* imlib 2 opengl backend work - transfer imlib image between states */
|
||||
/* of being client-side data, a texture set (an WxH array of textutes */
|
||||
/* tiled - to work around maximum texture size limitation of opengl) and */
|
||||
/* a buffer (using a pixmap as a destination drawable so we can render */
|
||||
/* ofscreen) */
|
||||
|
||||
typedef struct _evas_gl_image Evas_GL_Image;
|
||||
typedef enum _evas_gl_image_state Evas_GL_Image_State;
|
||||
|
||||
enum _evas_gl_image_state
|
||||
{
|
||||
EVAS_STATE_DATA,
|
||||
EVAS_STATE_TEXTURE
|
||||
};
|
||||
|
||||
struct _evas_gl_image
|
||||
{
|
||||
Evas_GL_Image_State state;
|
||||
int w, h;
|
||||
/* data specific params */
|
||||
DATA32 *data;
|
||||
/* common GL params */
|
||||
GLXContext context;
|
||||
/* texture state specific params */
|
||||
struct _tex
|
||||
{
|
||||
int max_size;
|
||||
int w, h;
|
||||
int edge_w, edge_h;
|
||||
GLuint *textures;
|
||||
} texture;
|
||||
/* buffer specific params */
|
||||
struct _buf
|
||||
{
|
||||
Display *display;
|
||||
XVisualInfo *visual_info;
|
||||
Colormap colormap;
|
||||
Window window;
|
||||
} buffer;
|
||||
};
|
||||
|
||||
void
|
||||
__evas_gl_copy_image_rect_to_texture(Evas_GL_Image *im, int x, int y,
|
||||
int w, int h, int tw, int th,
|
||||
|
@ -142,7 +82,7 @@ __evas_gl_move_state_data_to_texture(Evas_GL_Image *im)
|
|||
att.border_pixel = 0;
|
||||
att.event_mask = 0;
|
||||
im->buffer.window = XCreateWindow(im->buffer.display,
|
||||
RootWindow(disp, DefaultScreen(disp)),
|
||||
RootWindow(im->buffer.display, DefaultScreen(im->buffer.display)),
|
||||
0, 0, 32, 32, 0,
|
||||
im->buffer.visual_info->depth,
|
||||
InputOutput,
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glx.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xmu/StdCmap.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#include "Evas.h"
|
||||
|
||||
typedef struct _evas_gl_image Evas_GL_Image;
|
||||
typedef enum _evas_gl_image_state Evas_GL_Image_State;
|
||||
|
||||
enum _evas_gl_image_state
|
||||
{
|
||||
EVAS_STATE_DATA,
|
||||
EVAS_STATE_TEXTURE
|
||||
};
|
||||
|
||||
struct _evas_gl_image
|
||||
{
|
||||
Evas_GL_Image_State state;
|
||||
int w, h;
|
||||
/* data specific params */
|
||||
DATA32 *data;
|
||||
/* common GL params */
|
||||
GLXContext context;
|
||||
/* texture state specific params */
|
||||
struct _tex
|
||||
{
|
||||
int max_size;
|
||||
int w, h;
|
||||
int edge_w, edge_h;
|
||||
GLuint *textures;
|
||||
} texture;
|
||||
/* buffer specific params */
|
||||
struct _buf
|
||||
{
|
||||
Display *display;
|
||||
XVisualInfo *visual_info;
|
||||
Colormap colormap;
|
||||
Window window;
|
||||
} buffer;
|
||||
};
|
||||
|
||||
void __evas_gl_copy_image_rect_to_texture(Evas_GL_Image *im, int x, int y,
|
||||
int w, int h, int tw, int th,
|
||||
GLuint texture);
|
||||
void __evas_gl_move_state_data_to_texture(Evas_GL_Image *im);
|
||||
void __evas_calc_tex_and_poly(Evas_GL_Image *im, int x, double *x1, double *x2,
|
||||
int *tx, int *txx, double *dtx, double *dtxx, int tw, int w, int edge);
|
||||
void __evas_gl_render_to_window(Evas_GL_Image *im,
|
||||
Display *disp, Window w, int win_w, int win_h,
|
||||
int src_x, int src_y, int src_w, int src_h,
|
||||
int dst_x, int dst_y, int dst_w, int dst_h);
|
||||
Evas_GL_Image * __evas_gl_create_image(void);
|
||||
int __evas_gl_capable(Display *disp);
|
||||
Visual * __evas_gl_get_visual(Display *disp);
|
||||
Colormap __evas_gl_get_colormap(Display *disp);
|
||||
void __evas_gl_init(Display *disp);
|
||||
Evas_GL_Image * __evas_gl_image_new_from_file(Display *disp, char *file);
|
||||
void __evas_sync(Display *disp);
|
||||
void __evas_flush_draw(Display *disp, Window win);
|
||||
void __evas_draw_rectangle(Display *disp, Window win, int x, int y, int w, int h,
|
||||
int r, int g, int b, int a);
|
Loading…
Reference in New Issue