diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-02-09 18:38:28 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-02-09 18:38:28 +0100 |
commit | 9dc8ec29c02e4cbabb6f3b126b1707c289f6444f (patch) | |
tree | acd6f1bc35c5dc44cc0b949e8202669cea7a4658 | |
parent | ae0146752f12b20a8bbc8d0167a11865399ec324 (diff) |
Remove casts for native types
-rw-r--r-- | egl-wayland-pixmap-image.c | 2 | ||||
-rw-r--r-- | egl-wayland-pixmap-surface.c | 21 | ||||
-rw-r--r-- | egl-wayland-window.c | 16 |
3 files changed, 22 insertions, 17 deletions
diff --git a/egl-wayland-pixmap-image.c b/egl-wayland-pixmap-image.c index 993aa00..1b49241 100644 --- a/egl-wayland-pixmap-image.c +++ b/egl-wayland-pixmap-image.c @@ -105,7 +105,7 @@ init_egl(struct display *display) EGLBoolean ret; display->egl.dpy = - eglGetDisplay((EGLNativeDisplayType) display->egl_display); + eglGetDisplay(display->egl_display); assert(display->egl.dpy); ret = eglInitialize(display->egl.dpy, &major, &minor); diff --git a/egl-wayland-pixmap-surface.c b/egl-wayland-pixmap-surface.c index 1fd7da9..410402f 100644 --- a/egl-wayland-pixmap-surface.c +++ b/egl-wayland-pixmap-surface.c @@ -3,12 +3,12 @@ #include <stdbool.h> #include <assert.h> -#include <GL/gl.h> -#include <EGL/egl.h> - #include <wayland-client.h> #include <wayland-egl.h> +#include <GL/gl.h> +#include <EGL/egl.h> + struct display { struct wl_display *display; struct wl_egl_display *egl_display; @@ -51,12 +51,12 @@ init_egl(struct display *display) EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, - //EGL_DEPTH_SIZE, 1, + EGL_DEPTH_SIZE, 1, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, EGL_NONE }; - display->egl.dpy = eglGetDisplay((EGLNativeDisplayType) display->egl_display); + display->egl.dpy = eglGetDisplay(display->egl_display); assert(display->egl.dpy); assert(eglInitialize(display->egl.dpy, &major, &minor)); @@ -87,8 +87,7 @@ create_egl_surface(struct display *display, struct window *window) window->egl.surf = eglCreatePixmapSurface(display->egl.dpy, display->egl.conf, - (EGLNativePixmapType) window->egl_pixmap, - NULL); + window->egl_pixmap, NULL); assert(window->egl.surf); assert(eglMakeCurrent(display->egl.dpy, window->egl.surf, window->egl.surf, @@ -141,6 +140,10 @@ redraw(void *data, uint32_t time) glClearColor(0.0, 0.0, 0.0, 0.5); glClear(GL_COLOR_BUFFER_BIT); + GLint foo; + glGetIntegerv(GL_DRAW_BUFFER, &foo), + //printf("draw buffeR: 0x%x\n", foo); + glPushMatrix(); glRotatef(speed * (time-start_time), 0, 1, 0); @@ -159,6 +162,8 @@ redraw(void *data, uint32_t time) if (!window->buffer) window->buffer = wl_egl_pixmap_create_buffer( window->display->egl_display, window->egl_pixmap); + //printf("buffer. %p\n", window->buffer); + glFlush(); wl_egl_pixmap_flush(window->display->egl_display, window->egl_pixmap); //eglSwapBuffers(window->display->egl.dpy, window->egl.surf); @@ -170,7 +175,7 @@ redraw(void *data, uint32_t time) window->attached_height = window->height; wl_surface_damage(window->surface, 0, 0, - window->width, window->height); + window->width, window->height); wl_display_frame_callback(window->display->display, redraw, window); } diff --git a/egl-wayland-window.c b/egl-wayland-window.c index a051793..d8665a0 100644 --- a/egl-wayland-window.c +++ b/egl-wayland-window.c @@ -3,12 +3,12 @@ #include <stdbool.h> #include <assert.h> -#include <GL/gl.h> -#include <EGL/egl.h> - #include <wayland-client.h> #include <wayland-egl.h> +#include <GL/gl.h> +#include <EGL/egl.h> + struct display { struct wl_display *display; struct wl_egl_display *egl_display; @@ -44,7 +44,7 @@ init_egl(struct display *display) EGLint major, minor; EGLint num_config; EGLint config_attribs[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PIXMAP_BIT, EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, @@ -53,7 +53,7 @@ init_egl(struct display *display) EGL_NONE }; - display->egl.dpy = eglGetDisplay((EGLNativeDisplayType) display->egl_display); + display->egl.dpy = eglGetDisplay(display->egl_display); assert(display->egl.dpy); assert(eglInitialize(display->egl.dpy, &major, &minor)); @@ -74,15 +74,15 @@ create_egl_window(struct display *display, struct window *window) struct wl_visual *visual; visual = wl_display_get_premultiplied_argb_visual(display->display); - window->egl_window = wl_egl_window_create(window->surface, + window->egl_window = wl_egl_window_create(display->egl_display, + window->surface, window->width, window->height, visual); window->egl.surf = eglCreateWindowSurface(display->egl.dpy, display->egl.conf, - (EGLNativeWindowType) window->egl_window, - NULL); + window->egl_window, NULL); assert(window->egl.surf); assert(eglMakeCurrent(display->egl.dpy, window->egl.surf, window->egl.surf, |