Commit Graph

6 Commits

Author SHA1 Message Date
Robert Bragg
39aa5c27b5 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
41ec02c8b5 * 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
Neil Roberts
82d43ffe64 Bug 1189 - Backface culling
* clutter/cogl/gl/cogl-texture.c (cogl_texture_polygon)
	(_cogl_texture_quad_sw, _cogl_texture_quad_hw):
	* clutter/cogl/gles/cogl-texture.c (cogl_texture_polygon)
	(_cogl_texture_quad_sw, _cogl_texture_quad_hw): Enable backface
	culling in GL if it is requested.

	* clutter/cogl/gles/cogl-texture.c (_cogl_texture_quad_sw)
	(_cogl_texture_quad_hw):
	* clutter/cogl/gl/cogl-texture.c (_cogl_texture_quad_sw)
	(_cogl_texture_quad_hw): Reorder the
	vertices so that they are counter-clockwise.

	* clutter/cogl/gles/cogl-context.h (CoglContext): 
	* clutter/cogl/gl/cogl-context.h (CoglContext): Added a flag to
	store whether backface culling is currently enabled.

	* clutter/cogl/gles/cogl.c (cogl_enable_backface_culling): 
	* clutter/cogl/gl/cogl.c (cogl_enable_backface_culling): New
	function

	* doc/reference/cogl/cogl-sections.txt: Add
	cogl_enable_backface_culling
2008-10-27 14:36:52 +00:00
Neil Roberts
f9e43c440b * clutter/cogl/gl/cogl.c (error_string):
* clutter/cogl/gles/cogl.c (error_string): Rename to
	_cogl_error_string and remove the static scoping so that it can be
	called in cogl-texture etc.

	* clutter/cogl/gl/cogl-texture.c (cogl_texture_new_from_foreign):
	* clutter/cogl/gles/cogl-texture.c (cogl_texture_new_from_foreign):
	GE(*) can't be used to wrap around calls that use the return
	value.

	* clutter/cogl/gl/cogl-texture.c (_cogl_texture_quad_sw)
	(_cogl_texture_quad_hw, cogl_texture_polygon): Remove GE(*)
	wrapper around calls in the middle of a glBegin/glEnd pair which
	otherwise always generate an error because glGetError can only be
	called outside of the pair.

	* clutter/cogl/gl/cogl-internal.h: Include stdio.h when definig
	COGL_DEBUG and declare a prototype for _cogl_error_string.

	* clutter/cogl/gles/cogl-internal.h: Match GE(*) macro to GL
	version.
2008-05-21 13:20:33 +00:00
Ivan Leben
3d9f83019d * clutter/cogl/gles/cogl-texture.c:
(cogl_texture_download_from_gl:) Store old blending factors
	and restore them when done. The lack of ability to retrieve
	the alpha channel now more noticable in test-cogl-tex-getset
	since the edges of the hand are not antialiased.

	* clutter/cogl/gl(es)/cogl-internal.h: Declare
	cogl_blend_func to avoid "implicit implementation" compile
	warning.
2008-05-19 15:21:56 +00:00
Neil Roberts
6409b1adeb Merged clutter-ivan branch into trunk.
svn merge \
 https://svn.o-hand.com/repos/clutter/trunk/clutter@2509 \
 https://svn.o-hand.com/repos/clutter/branches/clutter-ivan@HEAD
2008-04-25 13:37:36 +00:00