mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
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__
|
#define __COGL_H__
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <clutter/clutter-color.h>
|
#include <clutter/clutter.h>
|
||||||
#include <clutter/clutter-feature.h>
|
|
||||||
#include <clutter/clutter-fixed.h>
|
|
||||||
#include <clutter/clutter-types.h>
|
|
||||||
|
|
||||||
#include "cogl-defines.h"
|
#include "cogl-defines.h"
|
||||||
|
|
||||||
@ -133,13 +130,13 @@ cogl_texture_quad (gint x1,
|
|||||||
ClutterFixed ty2);
|
ClutterFixed ty2);
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_textures_create (guint num, guint *textures);
|
cogl_textures_create (guint num, COGLuint *textures);
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_textures_destroy (guint num, const guint *textures);
|
cogl_textures_destroy (guint num, const COGLuint *textures);
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_texture_bind (COGLenum target, guint texture);
|
cogl_texture_bind (COGLenum target, COGLuint texture);
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_texture_set_alignment (COGLenum target,
|
cogl_texture_set_alignment (COGLenum target,
|
||||||
|
@ -27,16 +27,25 @@
|
|||||||
#define __COGL_DEFINES_H__
|
#define __COGL_DEFINES_H__
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <GL/Glee.h>
|
#include <GL/Glee.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if defined(HAVE_GL_GL_H)
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
#elif defined(HAVE_OPENGL_GL_H)
|
||||||
|
#include <OpenGL/gl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* WIN32 */
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef GLenum COGLenum;
|
typedef GLenum COGLenum;
|
||||||
typedef GLint COGLint;
|
typedef GLint COGLint;
|
||||||
|
typedef GLuint COGLuint;
|
||||||
|
|
||||||
/* FIXME + DOCUMENT */
|
/* FIXME + DOCUMENT */
|
||||||
|
|
||||||
|
41
gl/cogl.c
41
gl/cogl.c
@ -29,12 +29,6 @@
|
|||||||
|
|
||||||
#include "cogl.h"
|
#include "cogl.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#include <windows.h>
|
|
||||||
#include <GL/Glee.h>
|
|
||||||
#else
|
|
||||||
#include <GL/gl.h>
|
|
||||||
#endif
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef HAVE_CLUTTER_GLX
|
#ifdef HAVE_CLUTTER_GLX
|
||||||
@ -333,7 +327,7 @@ cogl_texture_can_size (COGLenum target,
|
|||||||
#ifdef GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB
|
#ifdef GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB
|
||||||
if (target == CGL_TEXTURE_RECTANGLE_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) );
|
GE( glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &max_size) );
|
||||||
|
|
||||||
@ -381,19 +375,19 @@ cogl_texture_quad (gint x1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_textures_create (guint num, guint *textures)
|
cogl_textures_create (guint num, COGLuint *textures)
|
||||||
{
|
{
|
||||||
GE( glGenTextures (num, textures) );
|
GE( glGenTextures (num, textures) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_textures_destroy (guint num, const guint *textures)
|
cogl_textures_destroy (guint num, const COGLuint *textures)
|
||||||
{
|
{
|
||||||
GE( glDeleteTextures (num, textures) );
|
GE( glDeleteTextures (num, textures) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_texture_bind (COGLenum target, guint texture)
|
cogl_texture_bind (COGLenum target, COGLuint texture)
|
||||||
{
|
{
|
||||||
GE( glBindTexture (target, texture) );
|
GE( glBindTexture (target, texture) );
|
||||||
}
|
}
|
||||||
@ -696,12 +690,25 @@ cogl_get_viewport (ClutterFixed v[4])
|
|||||||
void
|
void
|
||||||
cogl_get_bitmasks (gint *red, gint *green, gint *blue, gint *alpha)
|
cogl_get_bitmasks (gint *red, gint *green, gint *blue, gint *alpha)
|
||||||
{
|
{
|
||||||
|
GLint value;
|
||||||
if (red)
|
if (red)
|
||||||
GE( glGetIntegerv(GL_RED_BITS, red) );
|
{
|
||||||
if (green)
|
GE( glGetIntegerv(GL_RED_BITS, &value) );
|
||||||
GE( glGetIntegerv(GL_GREEN_BITS, green) );
|
*red = value;
|
||||||
if (blue)
|
}
|
||||||
GE( glGetIntegerv(GL_BLUE_BITS, blue) );
|
if (green)
|
||||||
if (alpha)
|
{
|
||||||
GE( glGetIntegerv(GL_ALPHA_BITS, alpha ) );
|
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 GLenum COGLenum;
|
||||||
typedef GLint COGLint;
|
typedef GLint COGLint;
|
||||||
|
typedef GLuint COGLuint;
|
||||||
|
|
||||||
/* extras */
|
/* extras */
|
||||||
|
|
||||||
|
@ -323,19 +323,19 @@ cogl_texture_quad (gint x1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_textures_create (guint num, guint *textures)
|
cogl_textures_create (guint num, COGLuint *textures)
|
||||||
{
|
{
|
||||||
GE( glGenTextures (num, textures) );
|
GE( glGenTextures (num, textures) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_textures_destroy (guint num, const guint *textures)
|
cogl_textures_destroy (guint num, const COGLuint *textures)
|
||||||
{
|
{
|
||||||
GE( glDeleteTextures (num, textures) );
|
GE( glDeleteTextures (num, textures) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_texture_bind (COGLenum target, guint texture)
|
cogl_texture_bind (COGLenum target, COGLuint texture)
|
||||||
{
|
{
|
||||||
GE( glBindTexture (target, texture) );
|
GE( glBindTexture (target, texture) );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user