Commit Graph

132 Commits

Author SHA1 Message Date
Emmanuele Bassi
8dca5c73bc Reuse the layers list
Instead of getting the layers list twice from the Material, we
can reuse the list when we need to retrieve the first layer.
2009-01-28 11:57:49 +00:00
Emmanuele Bassi
31e4ca5733 Fallout from cogl-material merge
When enabling the maintainer CFLAGS the compiler got very angry
at the code that has been merged.
2009-01-27 16:02:04 +00:00
Robert Bragg
a2e52eb3be Support scaling on the z axis with cogl_scale
This simply adds a z argument to cogl_scale and updates clutter-actor.c
to pass 1.0 for the z scale.
2009-01-27 15:20:13 +00:00
Robert Bragg
323eaf3fb3 Merge branch 'cogl-material'
Conflicts:

	clutter/cogl/gl/cogl-texture.c
	clutter/cogl/gles/cogl-primitives.c

* cogl-material:
 clutter-{clone-,}texture weren't updating their material opacity.
 Updates GLES1 support for CoglMaterial
 Normalizes gl vs gles code in preperation for synching material changes
 Removes cogl_blend_func and cogl_alpha_func
 Fully integrates CoglMaterial throughout the rest of Cogl
 [cogl-material] Restore the GL_TEXTURE_ENV_MODE after material_rectangle
 [cogl-material] Make the user_tex_coords parameter of _rectangle const
 [test-cogl-material] Remove return value from material_rectangle_paint
 Add cogl-material.h and cogl-matrix.h to libclutterinclude_HEADERS
 [cogl-material] improvements for cogl_material_rectangle
 [cogl-material] Adds a cogl_material_set_color function
 [cogl-material] Some improvements for how we sync CoglMaterial state with OpenGL
 [cogl-material] Converts clutter-texture/clutter-clone-texture to the material API
 [doc] Hooks up cogl-material reference documentation
 Updates previous GLES multi-texturing code to use CoglMaterial
 Adds a CoglMaterial abstraction, which includes support for multi-texturing
 [doc] Hooks up cogl-matrix reference documentation
 Adds CoglMatrix utility code
 [tests] Adds an interactive unit test for multi-texturing
 [multi-texturing] This adds a new cogl_multi_texture API for GL,GLES1 + GLES2
2009-01-27 15:19:34 +00:00
Robert Bragg
9abf44eac3 Updates GLES1 support for CoglMaterial
This updates cogl/gles in line with the integration of CoglMaterial throughout
Cogl that has been done for cogl/gl.

Note: This is still buggy, but at least it builds again and test-actors works.
Some GLES2 specific changes were made, but these haven't been tested yet.
2009-01-27 14:26:50 +00:00
Robert Bragg
e9a9acd28d Normalizes gl vs gles code in preperation for synching material changes
This changes all GLES code to use the OpenGL function names instead of
the cogl_wrap_* names. For GLES2 we now define the OpenGL name to point
to the wrapper, as opposed to defining the wrapper to point to the
OpenGL name for GLES1.

I've also done a quick pass through gl/cogl.c and gles/cogl.c to make
them more easily comparable. (most of the code is now identical)
2009-01-27 14:26:50 +00:00
Robert Bragg
94077997a7 Removes cogl_blend_func and cogl_alpha_func
The GL blend function and alpha function are now controlled by the material
code, and even internally Cogl should now be using the material API when
it needs control of these.
2009-01-27 14:26:49 +00:00
Robert Bragg
2503f7b321 Fully integrates CoglMaterial throughout the rest of Cogl
This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.

It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions

It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.

"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.

cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.

Most code that previously did:
  cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
  cogl_set_source_texture (tex_handle);
  cogl_rectangle_with_texture_coords (x, y,....);

In the less likely case where you were blending your source texture with a color
like:
  cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
  cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
  mat = cogl_material_new ();
  cogl_material_set_color4ub (r,g,b,a);
  cogl_material_set_layer (mat, 0, tex_handle));
  cogl_set_source_material (mat);

Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.

For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
  cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
  cogl_set_source_texture (tex_handle);
  cogl_polygon (verts, 3, TRUE);

All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.

Note: The GLES backend has not been updated yet; that will be done in a
following commit.
2009-01-27 14:26:39 +00:00
Robert Bragg
0c8c273980 Merge commit 'origin/master' into cogl-material
Conflicts:

	clutter/clutter-texture.c
	clutter/cogl/cogl-texture.h
	clutter/cogl/cogl.h.in
	clutter/cogl/common/Makefile.am
	clutter/cogl/gl/Makefile.am
	clutter/cogl/gles/Makefile.am
	clutter/cogl/gles/cogl-gles2-wrapper.c
	clutter/cogl/gles/cogl-gles2-wrapper.h
2009-01-23 15:23:49 +00:00
Emmanuele Bassi
9aedabc6a7 Split maintainer-flags from the compiler flags
The maintainer compiler flags we use trigger warnings and errors
in the autogenerated code that gtk-doc creates to scan the header
and source files. Since we cannot control that, and we must run
a distcheck with both --enable-gtk-doc and --enable-maintainer-flags
turned on, we need to use less-strict compiler flags when inside
the doc/reference subdirectories.

The way to do this is to split the maintainer compiler flags into
their own Makefile variable, called MAINTAINER_CFLAGS. The we
can use $(MAINTAINER_CFLAGS) in the INCLUDES or _CFLAGS sections
of each part of the source directories we wish to check with the
anal retentiveness suited for maintainers.
2009-01-23 13:09:51 +00:00
Emmanuele Bassi
726ee43761 Fix compiler warnings
The maintainer-flags option discovered the usual amount of
collisions and compiler warnings we have to fix in order to
get distcheck to pass.
2009-01-23 13:08:46 +00:00
Neil Roberts
7031791376 Fix some failures from the fixed-to-float script in cogl-texture
The script converted calls to COGL_FIXED_MUL(x,y) to (x*y). However
this fails for cases like this:

 COGL_FIXED_MUL(a + b, c)

which become

 (a + b * c)

The meaning of this is of course different because multiplication has
a higher precedence than addition.

This was causing breakages in cogl_texture_quad_sw when the vertex
coordinates are not in increasing order. This was the case in
test-backface-culling when NPOTs are not available.
2009-01-22 17:44:24 +00:00
Owen W. Taylor
66331b6863 Fix computation of camera distance
Compute the value of the camera distance as exactly half the xx
component of the projection matrix. The heuristically derived
value for 60 degrees was off by about 0.016%, causing noticeable
blurring, and other field of view angles which didn't have the
heuristic adjustment off by much more.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-01-22 14:17:16 +00:00
Emmanuele Bassi
799fdf364e Change the COGL texture constructor to use flags
Boolean arguments for functions are pretty evil and usually
lead to combinatorial explosion of parameters in case multiple
settings are added.

In the case of the COGL texture constructors we have a boolean
argument for enabling the auto-mipmapping; it is conceivable that
we might want to add more settings for a COGL texture without
breaking API or ABI compatibility, so the boolean argument should
become a bitmask.

The internals have not been changed: instead of checking for
a non-zero value, we check for a bitmask being set.
2009-01-21 10:14:29 +00:00
Robert Bragg
de41fdd9d1 Renames the mesh api to the "vertex buffer api".
This better reflects the fact that the api manages sets of vertex attributes,
and the attributes really have no implied form. It is only when you use the
attributes to draw that they become mesh like; when you specify how they should
be interpreted, e.g. as triangle lists or fans etc. This rename frees up the
term "mesh", which can later be applied to a concept slightly more fitting.
E.g. at some point it would be nice to have a higher level abstraction that
sits on top of cogl vertex buffers that adds the concept of faces. (Somthing
like Blender's mesh objects.) There have also been some discussions over
particle engines, and these can be defined in terms of emitter faces; so some
other kind of mesh abstraction might be usefull here.
2009-01-20 22:29:35 +00:00
Robert Bragg
4e60f2f5b0 [Automatic fixed-to-float.sh change] Applies a number fixed to float patches
To deal with all the corner cases that couldn't be scripted a number of patches
were written for the remaining 10% of the effort.

Note: again no API changes were made in Clutter, only in Cogl.
2009-01-20 16:20:54 +00:00
Robert Bragg
3336359abb [Automatic fixed-to-float.sh change] Applies all scripted changes
This is the result of running a number of sed and perl scripts over the code to
do 90% of the work in converting from 16.16 fixed to single precision floating
point.

Note: A pristine cogl-fixed.c has been maintained as a standalone utility API
      so that applications may still take advantage of fixed point if they
      desire for certain optimisations where lower precision may be acceptable.

Note: no API changes were made in Clutter, only in Cogl.

Overview of changes:
- Within clutter/* all usage of the COGL_FIXED_ macros have been changed to use
the CLUTTER_FIXED_ macros.

- Within cogl/* all usage of the COGL_FIXED_ macros have been completly stripped
and expanded into code that works with single precision floats instead.

- Uses of cogl_fixed_* have been replaced with single precision math.h
alternatives.

- Uses of COGL_ANGLE_* and cogl_angle_* have been replaced so we use a float for
angles and math.h replacements.
2009-01-20 16:20:54 +00:00
Robert Bragg
a0c5690d55 Merge commit 'origin/master' into cogl-material
Conflicts:

	clutter/clutter-texture.c
	clutter/cogl/cogl-texture.h
	clutter/cogl/gles/cogl-context.c
	clutter/cogl/gles/cogl-context.h
2009-01-13 13:37:38 +00:00
Emmanuele Bassi
743b5c03dc Merge branch 'master' into async-textures 2009-01-12 14:43:53 +00:00
Emmanuele Bassi
0ca5eeaeae Declare G_LOG_DOMAIN for COGL
In order to get properly namespaced debug and warning messages
inside COGL code we need to define the G_LOG_DOMAIN macro.
2009-01-12 11:21:06 +00:00
Chris Lord
0866b07f30 Update/clean and apply the async-texture patch from bug #1144 2009-01-07 17:02:43 +00:00
Neil Roberts
1530be0af9 Merge branch multiple-texture-rectangle into master
Bug 1289 - Draw multiple glyphs at once

The multiple-texture-rectangle branch adds a new Cogl texture function
called cogl_texture_multiple_rectangles which is used to draw multiple
rectangles out of a texture using a single GL call. This is
significantly faster than drawing the rectangles with individual calls
on some platforms. The Pango renderer now uses this to speed up
rendering.

The conflicts are just due to the whitespace fixes in cb569a5.

Conflicts:

	clutter/cogl/gl/cogl-context.c
	clutter/cogl/gl/cogl-context.h
	clutter/cogl/gl/cogl-texture.c
2009-01-07 16:25:26 +00:00
Neil Roberts
b6470ab900 [cogl-material] Restore the GL_TEXTURE_ENV_MODE after material_rectangle
The rest of Cogl expects the texture mode to be GL_MODULATE so it
needs to be restored after calling cogl_material_rectangle. Otherwise
cogl_texture_rectangle will fail to blend with the Cogl color properly
and all of the labels will be black.
2009-01-06 18:24:57 +00:00
Neil Roberts
cd71b91440 [cogl-material] Make the user_tex_coords parameter of _rectangle const
The array is only used for input so it should be const.
2009-01-06 16:09:55 +00:00
Neil Roberts
ba2257973e Add cogl-material.h and cogl-matrix.h to libclutterinclude_HEADERS
Otherwise they won't get installed
2009-01-06 15:53:35 +00:00
Robert Bragg
0408a5d2c5 [cogl-material] improvements for cogl_material_rectangle
The API has been changed to take an explicit length for the number of
texture coordinates passed, and it's now documented that if there are
more layers to the current material than the number of texture coords
passed, then default coordinates will be generated for the other
layers.

cogl_material_rectangle should now handle the case where a single
sliced texture is supplied as a material layer by falling back to
cogl_texture_rectangle. We are nearly at the point that
cogl_texture_rectangle could be deprecated. A few issues remain
though, such as not considering waste in cogl_material_rectangle.
2008-12-24 01:35:33 +00:00
Robert Bragg
e4548bcdc5 [cogl-material] Some improvements for how we sync CoglMaterial state with OpenGL
This flattens the three functions: cogl_material_flush_gl_material_state,
.._flush_gl_alpha_func and .._flush_gl_blend_func into one:
cogl_flush_material_gl_state which doesn't takes a material handle. (the handle
is instead taken from the context.)

This has allows us to avoid re-submitting some state to OpenGL when the
material has not been replaced.

Note: Avoiding redundant state changes for material layers isn't dealt with
in this patch.
2008-12-24 01:33:23 +00:00
Robert Bragg
ef992f55db Merge branch 'master' into cogl-material
Conflicts:

	clutter/cogl/gl/cogl-context.c
	clutter/cogl/gl/cogl-context.h
2008-12-24 00:59:13 +00:00
Robert Bragg
baa63b7c46 White space clean up across a number of files (only removing trailing spaces)
Removed trailing white space from the following files:
- clutter-clone-texture.c
- clutter-texture.c
- clutter-texture.h
- cogl/cogl-texture.h
- cogl/gl/cogl-context.c
- cogl/gl/cogl-texture.c
- cogl/gl/cogl-context.h
2008-12-24 00:48:32 +00:00
Robert Bragg
61b8cc1874 Adds a CoglMaterial abstraction, which includes support for multi-texturing
My previous work to provide muti-texturing support has been extended into
a CoglMaterial abstraction that adds control over the texture combine
functions (controlling how multiple texture layers are blended together),
the gl blend function (used for blending the final primitive with the
framebuffer), the alpha function (used to discard fragments based on
their alpha channel), describing attributes such as a diffuse, ambient and
specular color (for use with the standard OpenGL lighting model), and
per layer rotations. (utilizing the new CoglMatrix utility API)

For now the only way this abstraction is exposed is via a new
cogl_material_rectangle function, that is similar to cogl_texture_rectangle
but doesn't take a texture handle (the source material is pulled from
the context), and the array of texture coordinates is extended to be able
to supply coordinates for each layer.

Note: this function doesn't support sliced textures; supporting sliced
textures is a non trivial problem, considering the ability to rotate layers.
Note: cogl_material_rectangle, has quite a few workarounds, for a number of
other limitations within Cogl a.t.m.
Note: The GLES1/2 multi-texturing support has yet to be updated to use
the material abstraction.
2008-12-22 16:35:52 +00:00
Robert Bragg
509928cc76 [multi-texturing] This adds a new cogl_multi_texture API for GL,GLES1 + GLES2
Multitexturing allows blending multiple layers of texture data when texturing
some geometry. A common use is for pre-baked light maps which can give nice
lighting effects relativly cheaply. Another is for dot-3 bump mapping, and
another is applying alpha channel masks.

The dot-3 bump mapping would be really nice one day, but currently cogl doesn't
support lighting so that's not dealt with in this patch.

notable limitations:
- It can only texture rectangles a.t.m - and like cogl_texture_rectangle there
is no support for rotated texturing.
- Sliced textures are not supported. I think I've figured out how to handle
layers with different slice sizes at least for rectangular geometry, but I'm
not sure how complex it becomes once rotations are possible and texturing
arbitrary cogl_polygons.
- Except for this new API, cogl still doesn't know about more than one texture
unit, and so has no way of caching any enables related to other units. So that
things don't break it's currently necessary to disable anything to do with
additional units as soon as we are done with them which isn't ideal.
- No clutter API yet.
2008-12-22 16:35:51 +00:00
Neil Roberts
c3e4c6df08 Merge commit 'git-svn' into multiple-texture-rectangle 2008-12-10 12:25:25 +00:00
Neil Roberts
4aea0d6e48 * clutter/cogl/gl/cogl.c:
* clutter/cogl/gl/cogl-defines.h.in:
	* clutter/cogl/gl/cogl-context.h:
	* clutter/cogl/common/cogl-mesh.c: Rename the glBufferDataSub
	function to glBufferSubData. When calling glXGetProcAddress with
	the former Mesa returns a stub dispatch function which will
	segfault if you try to use it. With NVIDIA it returns NULL so
	_cogl_features_init decides the card doesn't have VBO support.
2008-12-10 12:13:20 +00:00
Neil Roberts
b11b74fcde Use a single index array
There's no point in clearing the index array because it is always the
same sequence of indices regardless of the vertices. Instead it is
just added to when there are more vertices than ever before.
2008-12-09 18:03:29 +00:00
Neil Roberts
59aef7488f Minor fix to indentation in gl/cogl-texture.c 2008-12-09 15:01:10 +00:00
Neil Roberts
778a9f7d67 Use glDrawRangeElements to share vertices
When drawing a quad from cogl_texture_multiple_rectangles share two of
the vertices in each triangle by using indices.
2008-12-09 13:02:28 +00:00
Neil Roberts
3b5eb3afeb Merge commit 'git-svn' into multiple-texture-rectangle
Conflicts:

	clutter/cogl/gl/cogl-texture.c
2008-12-04 18:20:57 +00:00
Neil Roberts
7a276affd6 Use the correct length in _cogl_texture_flush_vertices
The check for whether there are any rectangles to flush was using the
wrong value so it would always flush.

Thanks to Johan Bilien for spotting.
2008-12-04 17:50:03 +00:00
Neil Roberts
58f6aaa589 Bug 1297 - Bring back support for GL_ARB_texture_rectangle
* clutter/cogl/gl/cogl-texture.c (cogl_texture_new_from_foreign,
	(_cogl_texture_quad_hw, cogl_texture_polygon),
	(_cogl_texture_quad_sw): Support GL_ARB_texture_rectangle textures

	* clutter/glx/clutter-glx-texture-pixmap.c: Use rectangle textures
	when NPOTs are not available or it is forced by the
	CLUTTER_PIXMAP_TEXTURE_RECTANGLE environment variable.

	* clutter/cogl/gl/cogl.c (cogl_enable): Allow enabling
	GL_TEXTURE_RECTANGLE_ARB.
2008-12-04 17:24:33 +00:00
Neil Roberts
10d7cf3273 Bug 1172 - Disjoint paths and clip to path
* clutter/cogl/cogl-path.h:
	* clutter/cogl/common/cogl-primitives.c:
	* clutter/cogl/common/cogl-primitives.h:
	* clutter/cogl/gl/cogl-primitives.c:
	* clutter/cogl/gles/cogl-primitives.c: Changed the semantics of
	cogl_path_move_to. Previously this always started a new path but
	now it instead starts a new disjoint sub path. The path isn't
	cleared until you call either cogl_path_stroke, cogl_path_fill or
	cogl_path_new. There are also cogl_path_stroke_preserve and
	cogl_path_fill_preserve functions.

	* clutter/cogl/gl/cogl-context.c:
	* clutter/cogl/gl/cogl-context.h:
	* clutter/cogl/gles/cogl-context.c:
	* clutter/cogl/gles/cogl-context.h: Convert the path nodes array
	to a GArray.

	* clutter/cogl/gl/cogl-texture.c:
	* clutter/cogl/gles/cogl-texture.c: Call cogl_clip_ensure

	* clutter/cogl/common/cogl-clip-stack.c:
	* clutter/cogl/common/cogl-clip-stack.h: Simplified the clip
	stack code quite a bit to make it more maintainable.  Previously
	whenever you added a new clip it would go through a separate route
	to immediately intersect with the current clip and when you
	removed it again it would immediately rebuild the entire clip. Now
	when you add or remove a clip it doesn't do anything immediately
	but just sets a dirty flag instead.

	* clutter/cogl/gl/cogl.c:
	* clutter/cogl/gles/cogl.c: Taken away the code to intersect
	stencil clips when there is exactly one stencil bit. It won't work
	with path clips and I don't know of any platform that doesn't have
	eight or zero stencil bits. It needs at least three bits to
	intersect a path with an existing clip. cogl_features_init now
	just decides you don't have a stencil buffer at all if you have
	less than three bits.

	* clutter/cogl/cogl.h.in: New functions and documentation.

	* tests/interactive/test-clip.c: Replaced with a different test
	that lets you add and remove clips. The three different mouse
	buttons add clips in different shapes. This makes it easier to
	test multiple levels of clipping.

	* tests/interactive/test-cogl-primitives.c: Use
	cogl_path_stroke_preserve when using the same path again.

	* doc/reference/cogl/cogl-sections.txt: Document the new
	functions.
2008-12-04 13:45:09 +00:00
Neil Roberts
be655b05ad Bug 1305 - NPOT textures unaligned to a pixel sometimes have
border artifacts

	* clutter/cogl/gl/cogl-texture.c: Set the wrap mode of a texture
	on demand

	Instead of setting the wrap mode once per texture at creation, it
	is now changed whenever the texture is drawn. The previous value
	is cached so that it isn't changed if the value is the same.

	This is used in _cogl_texture_quad_hw to only enable GL_REPEAT
	mode when the coordinates are not in the range [0,1]. Otherwise it
	can pull in pixels from the other edge when the texture is
	rendered off-pixel.
2008-12-01 16:27:54 +00:00
Neil Roberts
420b1f0791 Use GL_TRIANGLES for the texture vertex array
Most cards don't actually support GL_QUADS and they are deprecated in
GL 3.0 so there is a chance it will perform faster with GL_TRIANGLES
even though it has to submit two extra vertices.
2008-11-28 14:20:07 +00:00
Neil Roberts
c502c5c3f4 Add cogl_texture_multiple_rectangles
This takes an array of sets of 8 floats to describe the rectangles. It
tries to send the geometry with a single glDrawArrays as far as
possible. cogl_texture_rectangle is now just a wrapper around
cogl_texture_multiple_rectangles.
2008-11-28 13:09:04 +00:00
Neil Roberts
47a21cd94f Make cogl_texture_rectangle use the vertex array
cogl_texture_quad_hw and _sw now just add vertices to the vertex
array. The last texture used is stored and if a different texture is
encountered then flushes the vertices. cogl_texture_rectangle always
flushes the vertices after calling either of the functions.
2008-11-28 12:33:19 +00:00
Neil Roberts
5557de30eb Use a GArray for the texture vertices in cogl_texture_polygon
Previously it was a dynamic array that was manually reallocated.
2008-11-27 16:44:39 +00:00
Neil Roberts
f4465ccb05 * clutter/cogl/gl/cogl-texture.c (cogl_texture_rectangle): Fixed
the test for whether to use hardware tiling. Previously it assumed
	that texture coordinates are in increasing order but this is not
	the case since bug 1057 was fixed. The texture coordinates are now
	sorted later. It also allowed negative coordinates which doesn't
	make sense if the texture has waste.
2008-11-26 16:35:25 +00:00
Neil Roberts
50b6ecc56d * clutter/cogl/gl/cogl-texture.c (cogl_texture_polygon): Fix the
equation for calculating texture coordinates when using sliced
	textures. This became broken in revision 3520.
2008-11-24 12:27:48 +00:00
Neil Roberts
d741f67cfc Bug 1271 - mingw compiling failed: undefined reference to
`_glDrawRangeElements@24'

	Resolve glDrawRangeElements with cogl_get_proc_address instead of
	calling it directly because functions defined in GL > 1.1 are not
	directly exported under Windows.

	* clutter/cogl/common/cogl-mesh.c: Use the function pointer from
	the context

	* clutter/cogl/gl/cogl-context.c (cogl_create_context): Initialise
	function pointer.

	* clutter/cogl/gl/cogl-context.h (CoglContext): Add a function
	pointer

	* clutter/cogl/gl/cogl-defines.h.in: Add a typedef for the
	function pointer.

	* clutter/cogl/gl/cogl.c (_cogl_features_init): Resolve
	glDrawRangeElements
2008-11-21 16:18:58 +00:00
Robert Bragg
8b557c6c13 A comparison of gl/cogl-texture.c and gles/cogl-texture.c, to reduce
differences and improve maintainability.

	* clutter/cogl/gl/cogl-context.h:
	Adds a CoglTextureGLVertex typedef + texture_vertices and
	texture_vertices_size members to CoglContext for using vertex arrays
	like GLES does

	* clutter/cogl/gl/cogl-context.c:
	Initializes texture_vertices + texture_vertices_size members

	* clutter/cogl/gl/cogl-internal.h:
	Adds COGL_ENABLE_COLOR_ARRAY

	* clutter/cogl/gl/cogl.c:
	Add COGL_ENABLE_COLOR_ARRAY support to cogl_enable

	* clutter/cogl/gles/cogl-context.h:
	Change the CoglTextureGLVertex to use GLfloat for the position
	and texture coord attributes and GLubyte for the color.

	* clutter/cogl/gles/cogl-texture-private.h:
	Adds a wrap_mode member like GL has.

	* clutter/cogl/gl/cogl-texture.c
	* clutter/cogl/gles/cogl-texture.c:
	Improves the comparability of the files, such that the remaining
	differences, better reflect the fundamental differences needed
	between GL and GLES. Notably GL no longer uses glBegin/glEnd for
	submitting vertices, it uses vertex arrays like GLES and this gives
	a small but measurable fps improvement for test-text.
2008-11-18 16:24:09 +00:00
Robert Bragg
6731dfa468 * clutter/cogl/gl/cogl-internal.h
* clutter/cogl/gles/cogl-internal.h:
	Removes semicolon after the GE() macro since that breaks using it as a
	single statement.
2008-11-18 16:23:40 +00:00