mutter/clutter/cogl/cogl.h
Matthew Allum a2bd6de736 2007-05-28 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-backend.c:
        * clutter/clutter-backend.h:
        * clutter/glx/clutter-stage-glx.c:
        * clutter/glx/clutter-backend-glx.c:
        Fix up rendering pipeline removing clutter_backend_XXX_stage_paint
        and adding clutter_backend_XXX_redraw instead. Duplicates less
        code in backends, avoids clutter_actor_paint() getting called
        before stage is set up (viewport wise) and unbreaks things like
        picking.

        * clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-main.c:
        * clutter/clutter-private.h:
        * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos):
        Redo picking functionality a different way (via color indexing)
        as to provide more flexibility, possibly speed and more likely
        work with GL/ES (doesn't currently however - not sure why).

        * clutter/clutter-group.c:
        Add groups own 'pick' method.

        * clutter/cogl/cogl.h:
        * clutter/cogl/gl/cogl.c:
        * clutter/cogl/gles/cogl.c:
        Move clipping funtionality into cogl.

        * clutter/cogl/gles/cogl-defines.h:
        Hack around missing BGR format in GL/ES.

        * clutter/egl/clutter-backend-egl.c:
        * clutter/egl/clutter-backend-egl.h:
        * clutter/egl/clutter-stage-egl.c:
        * clutter/sdl/clutter-backend-sdl.c:
        * clutter/sdl/clutter-backend-sdl.h:
        * clutter/sdl/clutter-event-sdl.c:
        * clutter/sdl/clutter-stage-sdl.c:
        Update backends to newer API.
        Add basic mouse event translation to SDL.
2007-05-28 18:49:34 +00:00

194 lines
4.1 KiB
C

/*
* Clutter COGL
*
* A basic GL/GLES Abstraction/Utility Layer
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2007 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* COGL
* ====
*
* 'cogl' is a very simple abstraction layer which wraps GL and GLES.
*
*
* !!!! DO NOT USE THIS API YET OUTSIDE OF CLUTTER CORE !!!!
* THE API WILL FLUCTUATE WILDLY
*
* TODO:
* - Use ClutterReal for fixed/float params.
* - Add Perspective/viewport setup
* - Add Features..
*/
#ifndef __COGL_H__
#define __COGL_H__
#include <glib.h>
#include <clutter/clutter.h>
#include "cogl-defines.h"
G_BEGIN_DECLS
#define CGL_ENABLE_BLEND (1<<1)
#define CGL_ENABLE_TEXTURE_2D (1<<2)
#define CGL_ENABLE_ALPHA_TEST (1<<3)
#define CGL_ENABLE_TEXTURE_RECT (1<<4)
typedef void (*CoglFuncPtr) (void);
CoglFuncPtr
cogl_get_proc_address (const gchar* name);
gboolean
cogl_check_extension (const gchar *name, const gchar *ext);
void
cogl_perspective (ClutterAngle fovy,
ClutterFixed aspect,
ClutterFixed zNear,
ClutterFixed zFar);
void
cogl_setup_viewport (guint width,
guint height,
ClutterAngle fovy,
ClutterFixed aspect,
ClutterFixed z_near,
ClutterFixed z_far);
void
cogl_paint_init (const ClutterColor *color);
void
cogl_push_matrix (void);
void
cogl_pop_matrix (void);
void
cogl_scale (ClutterFixed x, ClutterFixed z);
void
cogl_translatex (ClutterFixed x, ClutterFixed y, ClutterFixed z);
void
cogl_translate (gint x, gint y, gint z);
void
cogl_rotatex (ClutterFixed angle, gint x, gint y, gint z);
void
cogl_rotate (gint angle, gint x, gint y, gint z);
void
cogl_color (const ClutterColor *color);
void
cogl_clip_set (const ClutterGeometry *clip);
void
cogl_clip_unset (void);
void
cogl_enable (gulong flags);
gboolean
cogl_texture_can_size (COGLenum pixel_format,
COGLenum pixel_type,
int width,
int height);
void
cogl_texture_quad (gint x1,
gint x2,
gint y1,
gint y2,
ClutterFixed tx1,
ClutterFixed ty1,
ClutterFixed tx2,
ClutterFixed ty2);
void
cogl_textures_create (guint num, guint *textures);
void
cogl_textures_destroy (guint num, const guint *textures);
void
cogl_texture_bind (COGLenum target, guint texture);
void
cogl_texture_set_alignment (COGLenum target,
guint alignment,
guint row_length);
void
cogl_texture_set_filters (COGLenum target,
COGLenum min_filter,
COGLenum max_filter);
void
cogl_texture_set_wrap (COGLenum target,
COGLenum wrap_s,
COGLenum wrap_t);
void
cogl_texture_image_2d (COGLenum target,
COGLint internal_format,
gint width,
gint height,
COGLenum format,
COGLenum type,
const guchar* pixels);
void
cogl_texture_sub_image_2d (COGLenum target,
gint xoff,
gint yoff,
gint width,
gint height,
COGLenum format,
COGLenum type,
const guchar* pixels);
void
cogl_rectangle (gint x, gint y, guint width, guint height);
void
cogl_trapezoid (gint y1,
gint x11,
gint x21,
gint y2,
gint x12,
gint x22);
void
cogl_alpha_func (COGLenum func,
ClutterFixed ref);
ClutterFeatureFlags
cogl_get_features ();
G_END_DECLS
#endif /* __COGL_H__ */