2007-10-26 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-texture.c: * clutter/cogl/cogl.h: * clutter/cogl/gl/cogl-defines.h: * clutter/cogl/gles/cogl-defines.h: * clutter/cogl/gl/cogl.c: * clutter/cogl/gles/cogl.c: Switch from use of guint to COGLuint. Avoids problems when guint != GLuint on some platforms, i.e OSX. (Tommi Komulainen, #526) * clutter/Makefile.am: * clutter/osx/Makefile.am: * clutter/osx/clutter-backend-osx.c: * clutter/osx/clutter-backend-osx.h: * clutter/osx/clutter-event-osx.c: * clutter/osx/clutter-osx.h: * clutter/osx/clutter-stage-osx.c: * clutter/osx/clutter-stage-osx.h: * configure.ac: Add initial Cocoa/OSX Backend (by Tommi Komulainen, see #526)
This commit is contained in:
parent
bcc81bdf1b
commit
4ff00fa191
11
cogl.h
11
cogl.h
@ -43,10 +43,7 @@
|
||||
#define __COGL_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <clutter/clutter-color.h>
|
||||
#include <clutter/clutter-feature.h>
|
||||
#include <clutter/clutter-fixed.h>
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include "cogl-defines.h"
|
||||
|
||||
@ -133,13 +130,13 @@ cogl_texture_quad (gint x1,
|
||||
ClutterFixed ty2);
|
||||
|
||||
void
|
||||
cogl_textures_create (guint num, guint *textures);
|
||||
cogl_textures_create (guint num, COGLuint *textures);
|
||||
|
||||
void
|
||||
cogl_textures_destroy (guint num, const guint *textures);
|
||||
cogl_textures_destroy (guint num, const COGLuint *textures);
|
||||
|
||||
void
|
||||
cogl_texture_bind (COGLenum target, guint texture);
|
||||
cogl_texture_bind (COGLenum target, COGLuint texture);
|
||||
|
||||
void
|
||||
cogl_texture_set_alignment (COGLenum target,
|
||||
|
@ -27,16 +27,25 @@
|
||||
#define __COGL_DEFINES_H__
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#include <windows.h>
|
||||
#include <GL/Glee.h>
|
||||
|
||||
#else
|
||||
|
||||
#if defined(HAVE_GL_GL_H)
|
||||
#include <GL/gl.h>
|
||||
#elif defined(HAVE_OPENGL_GL_H)
|
||||
#include <OpenGL/gl.h>
|
||||
#endif
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef GLenum COGLenum;
|
||||
typedef GLint COGLint;
|
||||
typedef GLuint COGLuint;
|
||||
|
||||
/* FIXME + DOCUMENT */
|
||||
|
||||
|
41
gl/cogl.c
41
gl/cogl.c
@ -29,12 +29,6 @@
|
||||
|
||||
#include "cogl.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#include <GL/Glee.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_CLUTTER_GLX
|
||||
@ -333,7 +327,7 @@ cogl_texture_can_size (COGLenum target,
|
||||
#ifdef GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB
|
||||
if (target == CGL_TEXTURE_RECTANGLE_ARB)
|
||||
{
|
||||
gint max_size = 0;
|
||||
GLint max_size = 0;
|
||||
|
||||
GE( glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &max_size) );
|
||||
|
||||
@ -381,19 +375,19 @@ cogl_texture_quad (gint x1,
|
||||
}
|
||||
|
||||
void
|
||||
cogl_textures_create (guint num, guint *textures)
|
||||
cogl_textures_create (guint num, COGLuint *textures)
|
||||
{
|
||||
GE( glGenTextures (num, textures) );
|
||||
}
|
||||
|
||||
void
|
||||
cogl_textures_destroy (guint num, const guint *textures)
|
||||
cogl_textures_destroy (guint num, const COGLuint *textures)
|
||||
{
|
||||
GE( glDeleteTextures (num, textures) );
|
||||
}
|
||||
|
||||
void
|
||||
cogl_texture_bind (COGLenum target, guint texture)
|
||||
cogl_texture_bind (COGLenum target, COGLuint texture)
|
||||
{
|
||||
GE( glBindTexture (target, texture) );
|
||||
}
|
||||
@ -696,12 +690,25 @@ cogl_get_viewport (ClutterFixed v[4])
|
||||
void
|
||||
cogl_get_bitmasks (gint *red, gint *green, gint *blue, gint *alpha)
|
||||
{
|
||||
GLint value;
|
||||
if (red)
|
||||
GE( glGetIntegerv(GL_RED_BITS, red) );
|
||||
if (green)
|
||||
GE( glGetIntegerv(GL_GREEN_BITS, green) );
|
||||
if (blue)
|
||||
GE( glGetIntegerv(GL_BLUE_BITS, blue) );
|
||||
if (alpha)
|
||||
GE( glGetIntegerv(GL_ALPHA_BITS, alpha ) );
|
||||
{
|
||||
GE( glGetIntegerv(GL_RED_BITS, &value) );
|
||||
*red = value;
|
||||
}
|
||||
if (green)
|
||||
{
|
||||
GE( glGetIntegerv(GL_GREEN_BITS, &value) );
|
||||
*green = value;
|
||||
}
|
||||
if (blue)
|
||||
{
|
||||
GE( glGetIntegerv(GL_BLUE_BITS, &value) );
|
||||
*blue = value;
|
||||
}
|
||||
if (alpha)
|
||||
{
|
||||
GE( glGetIntegerv(GL_ALPHA_BITS, &value ) );
|
||||
*alpha = value;
|
||||
}
|
||||
}
|
||||
|
@ -439,6 +439,7 @@ G_BEGIN_DECLS
|
||||
|
||||
typedef GLenum COGLenum;
|
||||
typedef GLint COGLint;
|
||||
typedef GLuint COGLuint;
|
||||
|
||||
/* extras */
|
||||
|
||||
|
@ -323,19 +323,19 @@ cogl_texture_quad (gint x1,
|
||||
}
|
||||
|
||||
void
|
||||
cogl_textures_create (guint num, guint *textures)
|
||||
cogl_textures_create (guint num, COGLuint *textures)
|
||||
{
|
||||
GE( glGenTextures (num, textures) );
|
||||
}
|
||||
|
||||
void
|
||||
cogl_textures_destroy (guint num, const guint *textures)
|
||||
cogl_textures_destroy (guint num, const COGLuint *textures)
|
||||
{
|
||||
GE( glDeleteTextures (num, textures) );
|
||||
}
|
||||
|
||||
void
|
||||
cogl_texture_bind (COGLenum target, guint texture)
|
||||
cogl_texture_bind (COGLenum target, COGLuint texture)
|
||||
{
|
||||
GE( glBindTexture (target, texture) );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user