Commit Graph

69 Commits

Author SHA1 Message Date
Neil Roberts
153f5ea73f 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
c8b4de2d6d Bug 1196 - Texture border drawing problems
* clutter/cogl/gl/cogl-texture.c (_cogl_texture_upload_subregion_to_gl)
	(_cogl_texture_upload_to_gl):

	* clutter/cogl/gles/cogl-texture.c (_cogl_texture_upload_to_gl)
	(_cogl_texture_upload_subregion_to_gl):
	
	When uploading data to a sliced texture, fill the waste pixels
	with copies of the edge of the real texture data. Otherwise the
	value of the waste pixels are undefined so it will show artifacts
	when the texture is scaled with GL_LINEAR and the pixels are
	blended in.
2008-10-27 12:39:22 +00:00
Neil Roberts
ae1a4a6a30 Bug 1043 - COGL calls glTexSubImage2D() with out-of-bounds
values (SIGSEGV)

	* clutter/cogl/gl/cogl-texture.c
	(_cogl_texture_upload_subregion_to_gl): When iterating over the
	slices, discard ones that don't intersect immediatly otherwise it
	will call glTexSubImage2D with a negative width/height and then
	move the source position incorrectly. Thanks to Gwenole
	Beauchesne.
2008-10-20 15:54:17 +00:00
Neil Roberts
238e9c3a1a Bug 1048 - SIGFPE in cogl_texture_set_region() with nvidia
* clutter/cogl/gl/cogl-texture.c (cogl_texture_set_region):
	* clutter/cogl/gles/cogl-texture.c (cogl_texture_set_region):
	Don't attempt to upload any data if the width or height of the
	subregion is zero. Thanks to Gwenole Beauchesne.
2008-09-18 13:16:15 +00:00
Neil Roberts
ef76d8e5e2 Bug 945 - Clipping+fbo cloning bugs
* clutter/cogl/gl/cogl.c: 
	* clutter/cogl/gles/cogl.c: 
	* clutter/cogl/cogl.h.in: Add cogl_clip_stack_save,
	cogl_clip_stack_restore, cogl_viewport and cogl_frustum.

	* clutter/cogl/gl/cogl-fbo.h: 
	* clutter/cogl/gl/cogl-fbo.c: Try to attach a stencil buffer when
	creating an FBO.

	* clutter/cogl/common/cogl-clip-stack.c: Add functions to save and
	restore the whole state of the stack.

	* clutter/clutter-texture.c (clutter_texture_paint): When
	rendering the FBO source, setup a temporary asymmetric perspective
	projection matrix to render it as it would appear on screen.

	* clutter/clutter-private.h: 
	* clutter/clutter-actor.c
	(_clutter_actor_apply_modelview_transform_recursive): No longer
	static and exported in clutter-private.h
2008-08-01 12:23:57 +00:00
Neil Roberts
add02e70a3 Bug 985 - MSC math.h / M_PI issue
* clutter/cogl/gl/cogl.c (set_clip_plane): 
	* clutter/clutter-alpha.c (sinc_func): Use G_PI instead of M_PI
	because M_PI isn't defined in MSVC without a special
	#define. Thanks to Haakon Sporsheim
2008-06-30 16:15:53 +00:00
Matthew Allum
2666778c26 2008-06-27 Matthew Allum <mallum@openedhand.com>
* clutter/cogl/gl/cogl.c:
        Temp workaround for 10.4 ATI card OSX folks, see #929
        (Tommi Komulainen)

        Bug 998 - clutter always captures X input events

* clutter/eglx/clutter-stage-egl.c:
        * clutter/glx/clutter-stage-glx.c:
When we disable X event retrival, dont still select for window
events.
2008-06-27 23:02:30 +00:00
Neil Roberts
7c69ca2997 Bug 918 - Group doesn't clip if it's children are clipped
* clutter/cogl/common/cogl-clip-stack.h: 
	* clutter/cogl/common/cogl-clip-stack.c: Added functions to
	maintain a stack of clipping rectangles.

	* clutter/cogl/gles/cogl.c: 
	* clutter/cogl/gl/cogl.c: The cogl_clip_set and unset functions
	have moved into cogl-clip-stack.c which calls back to cogl.c to
	set the actual rectangles. Multiple clip rectangles are combined
	by merging the stencil buffers.

	* clutter/cogl/gles/cogl-primitives.c (_cogl_path_fill_nodes): 
	* clutter/cogl/gl/cogl-primitives.c (_cogl_path_fill_nodes): Merge
	the stencil buffer with the contents of the clipping stack after
	drawing the path.

	* clutter/cogl/gles/cogl-context.h (CoglContext): 
	* clutter/cogl/gl/cogl-context.h (CoglContext): Store the number
	of available stencil bits.

	* clutter/cogl/common/Makefile.am
	(libclutter_cogl_common_la_SOURCES): Added cogl-clip-stack.c
2008-06-23 14:57:36 +00:00
Emmanuele Bassi
76b5a93afa 2008-06-23 Emmanuele Bassi <ebassi@openedhand.com>
Bug 982 - __COGL_GET_CONTEXT MS compiler issue (Haakon Sporsheim)

	* clutter/cogl/common/cogl-handle.h:
	* clutter/cogl/common/cogl-primitives.c: Remove C99-isms.

	* clutter/cogl/gl/cogl-fbo.c:
	* clutter/cogl/gl/cogl-primitives.c:
	* clutter/cogl/gl/cogl-texture.c:
	* clutter/cogl/gl/cogl.c: Ditto as above.

	* clutter/cogl/gles/cogl-fbo.c:
	* clutter/cogl/gles/cogl-primitives.c:
	* clutter/cogl/gles/cogl-texture.c: Ditto as above.
2008-06-23 11:01:30 +00:00
Matthew Allum
c468bdb564 Revert miscommit of unfinished cogl changes in r2920 2008-06-14 22:07:23 +00:00
Matthew Allum
6fe15aefb0 2008-06-14 Matthew Allum <mallum@openedhand.com>
* README:
        Make needed GL version 1.4, note GLES2 support, add some notes
        for COGL.
2008-06-13 23:03:45 +00:00
Matthew Allum
04845aa9c9 2008-06-06 Matthew Allum <mallum@openedhand.com>
Bug #948 - Remove texture rectangle support

        * clutter/clutter-feature.c:
        * clutter/clutter-feature.h:
        * clutter/clutter-texture.c:
        * clutter/cogl/gl/cogl.c:
* clutter/glx/clutter-glx-texture-pixmap.c:
        Remove support for GL_TEXTURE_RECTANGLE_ARB (now using just regular
        2D textures, with optional npots extension). Simplifys code, + makes
        mipmap & shader support much more sane.
2008-06-06 13:44:22 +00:00
Tommi Komulainen
93abcf9595 cogl: define GL_READ/DRAW_FRAMEBUFFER_EXT if not available
Bug 913 - cogl fails to build on OSX

	* clutter/cogl/gl/cogl-fbo.c: define GL_READ_FRAMEBUFFER_EXT and
	GL_DRAW_FRAMEBUFFER_EXT if not defined in the build system. The
	#ifdef can fail if they're not #defines but variables or enums.
	As the values are supposed to be industry standard even then
	it shouldn't have ill effects.
2008-06-05 21:40:59 +00:00
Neil Roberts
e306b0135c Applied 'final patch' from bug #874
* clutter/cogl/gles/cogl.c:
	* clutter/cogl/gl/cogl.c: The clip planes are now set using the
	inverse projection matrix as the modelview matrix so that they can
	be specified in screen coordinates.

	* clutter/cogl/gles/cogl-context.h (CoglContext):
	* clutter/cogl/gl/cogl-context.h (CoglContext): Added a member to
	cache the inverse projection matrix

	* clutter/clutter-fixed.h: Added a constant for converting from
	radians to degrees.

	* clutter/clutter-fixed.c (clutter_atani, clutter_atan2i): Added
	fixed-point versions of atan and atan2.

	* tests/test-clip.c: Added a test for clipping with various
	rotations and depths.

	* tests/Makefile.am (noinst_PROGRAMS): Added test-clip
2008-06-02 12:34:10 +00:00
Neil Roberts
46be48f8f6 * clutter/cogl/gl/cogl-context.c (cogl_destroy_context): Fix
cut-and-paste error where the wrong arrays were being freed.
2008-06-02 09:35:43 +00:00
Emmanuele Bassi
e50099a206 2008-05-23 Emmanuele Bassi <ebassi@openedhand.com>
Bug #912 - Invalid use of int* as parameter for glGetIntegerv

	* clutter/cogl/gl/cogl.c (_cogl_features_init): Use GLint
	instead of int. (#912, Tommi Komulainen)
2008-05-23 15:23:40 +00:00
Neil Roberts
eccd9399e5 * 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
006573ac61 * 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
Ivan Leben
d049d9ead4 * clutter/cogl/gl(es)/cogl.c: New internal function
cogl_blend_func caches blending setup much like cogl_enable
	does with the enable flags. This separates blending factors
	setup from the enable/disable operation in preparation of
	the texture image retrieval fix for alpha channel on GLES.
	(cogl_enable:) Does not modify blending factors anymore.

	* clutter/cogl/gl(es)/cogl-context.h: CoglContext holds two
	new variables to cache blending src and dst factors.

	* clutter/cogl/gl(es)/cogl-context.c:
	(cogl_create_context:) Initialize blending factors.

	* clutter/cogl/gles/cogl-texture.c:
	(cogl_texture_download_from_gl:) Set blending factors to
	CGL_ONE, CGL_ZERO which fixes the slighlty improper behavior
	where source colour was actually multiplied with its alpha
	value in the result (not noticable on current tests).
2008-05-19 15:02:27 +00:00
Neil Roberts
ae444ad679 Use the Mesa headers instead of depending on GLee for Win32
builds.

	* configure.ac: No longer check for GLee

	* clutter/cogl/gl/cogl-defines.h.in: Don't bother including GLee.h

	* build/mingw/mingw-cross-compile.sh: No longer downloads libGLee
	but downloads the Mesa library instead and installs the headers
	from that. Fixed the libpng version.
2008-05-16 11:09:59 +00:00
Ivan Leben
02ab70efc8 * clutter/cogl/gl/cogl-defines.h.in:
Fix GL function prototypes on OS X by #definining APIENTRY and
	APIENTRYP if missing.
2008-05-13 04:56:06 +00:00
Ivan Leben
3a3712d924 * clutter/cogl/gl/cogl-defines.h.in:
Defined GL extension functions used by Cogl inside the COGL_
	namespace.

	* clutter/cogl/gl/cogl-context.h:
	* clutter/cogl/gl/cogl.c:
	Use COGL_ extension function prototypes instead of relying
	on glext.h to define them. Should fix the mac compilability
	bug, but haven't tested it yet.
2008-05-12 17:20:22 +00:00
Ivan Leben
b9827fb945 * clutter/cogl/cogl.h.in:
* clutter/cogl/gl(es)/cogl-texture.h:
	* clutter/cogl/gl(es)/cogl-texture.c:
	cogl_texture_new_* functions take a gboolean auto_mipmap argument.
	If TRUE automatic mipmap generation is enabled during the process
	of slice texture object creation.
	(cogl_texture_new_from_foreign:) now allows mipmap min filter
	flags.

	* clutter/clutter-texture.c:
	* clutter/glx/clutter-glx-texture-pixmap.c:
	* tests/test-cogl-offscreen.c:
	* tests/test-cogl-tex-tile.c:
	* tests/test-cogl-tex-convert.c:
	* tests/test-cogl-tex-polygon.c:
	* tests/test-cogl-tex-getset.c:
	Pass FALSE for auto_mipmap to cogl_texture_new_*.

	* clutter/pango/pangoclutter-render.c:
	(tc_get:) Pass TRUE to cogl_texture_new_with_size and use mipmap
	min filter for nicer glyphs at small scales. As a result test-text
	has gone all beautiful now.
2008-05-07 16:12:54 +00:00
Øyvind Kolås
073870dbbf * clutter/cogl/gl/cogl-primitives.c:
* clutter/cogl/gles/cogl-primitives.c: 
* clutter/cogl/common/cogl-primitives.c: moved declaration of
gegl_rectangle and gegl_rectanglex here to satisfy linking
requirements when building the fruity backend.
2008-05-05 12:01:19 +00:00
Øyvind Kolås
f2b44899f9 * clutter/cogl/cogl.h.in: api review touch ups.
* clutter/cogl/common/cogl-primitives.c: api review touch ups.
* clutter/cogl/gl/cogl-primitives.c: (cogl_path_fill),
(cogl_path_stroke): indentation.
* clutter/cogl/gles/cogl-primitives.c:
(_cogl_path_fill_nodes): free allocated resources.
* tests/test-cogl-primitives.c: updated to new API, added rotation to
test to show that cogl renders paths correct under perspective
distortion.
2008-05-05 10:25:11 +00:00
Øyvind Kolås
96f679a18b * clutter/cogl/common/Makefile.am:
* clutter/cogl/common/cogl-primitives.c:
* clutter/cogl/common/cogl-primitives.h:
* clutter/cogl/gl/Makefile.am:
* clutter/cogl/gl/cogl-primitives.c:
* clutter/cogl/gl/cogl-primitives.h:
* clutter/cogl/gles/Makefile.am:
* clutter/cogl/gles/cogl-primitives.c:
* clutter/cogl/gles/cogl-primitives.h: moved duplicated code to the
common directory.
2008-04-30 15:05:17 +00:00
Neil Roberts
0e0890a2e9 Removed COGLhandle and changed shader and program functions to be
wrapped in reference-counted CoglHandles instead.

	* clutter/cogl/gl/cogl-shader.c: 
	* clutter/cogl/gl/cogl-shader.h: 
	* clutter/cogl/gl/cogl-program.c: 
	* clutter/cogl/gl/cogl-program.h: 
	New files to hold the shader and program functions.

	* clutter/cogl/gl/cogl.c: Removed shader and program functions.

	* clutter/cogl/common/cogl-handle.h: New header to define
	COGL_HANDLE_DEFINE which helps build functions to create
	reference-counted handles. This reduces the amount of duplicated
	code.

	* clutter/cogl/gl/cogl-texture.c: 
	* clutter/cogl/gles/cogl-texture.c: 
	* clutter/cogl/gl/cogl-fbo.c: Converted to use COGL_HANDLE_DEFINE
	from cogl-handle.h to avoid duplicating some of the common code.

	* clutter/cogl/gles/cogl-defines.h.in: 
	* clutter/cogl/gl/cogl-defines.h.in: Removed COGLhandle

	* clutter/cogl/gl/cogl-context.h: Added handle arrays for programs
	and shaders.

	* clutter/cogl/gl/cogl-context.c (cogl_create_context): Added
	initialisers for shader_handles and program_handles.
	(cogl_destroy_context): Added calls to g_array_free for all handle
	arrays.

	* clutter/cogl/gl/Makefile.am (libclutter_cogl_la_SOURCES): Added
	cogl-{program,shader}.{c,h}

	* clutter/cogl/common/Makefile.am
	(libclutter_cogl_common_la_SOURCES): Added cogl-handle.h

	* clutter/cogl/gles/cogl.c:
	* clutter/cogl/cogl.h.in: Programs and shaders are now wrapped in
	CoglHandles instead of COGLhandles. cogl_program_destroy and
	cogl_shader_destroy is now replaced with cogl_program_unref and
	cogl_shader_unref. cogl_program_ref and cogl_shader_ref are also
	added.

	* clutter/clutter-shader.c: Converted to use CoglHandles for the
	programs and shaders instead of COGLhandles.

	* cogl/cogl-sections.txt: Added cogl_shader_ref,
	cogl_shader_unref, cogl_is_shader, cogl_program_ref,
	cogl_program_unref, cogl_is_program and cogl_is_offscreen.
2008-04-29 16:10:37 +00:00
Øyvind Kolås
6a4cdd6e49 * clutter/cogl/cogl.h.in: renaming of API's in cogl to make the
primitives and path API a bit smaller and more resembling cairo.
* clutter/cogl/gl/cogl-primitives.c:
* clutter/cogl/gles/cogl-primitives.c:
* clutter/cogl/gles/cogl.c:
* clutter/clutter-actor.c:
* clutter/clutter-rectangle.c:
* tests/test-cogl-offscreen.c:
* tests/test-cogl-primitives.c:
* tests/test-cogl-tex-convert.c:
* tests/test-cogl-tex-foreign.c:
* tests/test-cogl-tex-getset.c:
* tests/test-cogl-tex-tile.c: updated according to changes in cogl.
2008-04-29 15:41:34 +00:00
Neil Roberts
046569f090 Fixed 'make dist'
* clutter/cogl/Makefile.am (EXTRA_DIST): Distribute cogl.h.in
	instead of cogl.h
	(DIST_SUBDIRS): Added common folder

	* clutter/cogl/gl/Makefile.am (libclutter_cogl_la_SOURCES): Remove
	cogl-defines.h and use the right location for cogl-defines.gl.h
	(EXTRA_DIST): Distribute cogl-defines.h.in

	* clutter/cogl/gles/Makefile.am (libclutter_cogl_la_SOURCES):
	Remove cogl-defines.h and use the right location for
	cogl-defines.gles.h
	(EXTRA_DIST): Distribute cogl-defines.h.in

	* clutter/Makefile.am (DIST_SUBDIRS): Add fruity
2008-04-28 16:57:44 +00:00
Øyvind Kolås
2b7ff6fed0 * clutter/cogl/cogl.h.in: moved the documentation of the cogl
primitives to the main public header.
* clutter/cogl/gl/cogl-primitives.c: from here ..
* clutter/cogl/gles/cogl-primitives.c: .. _and_ here.
2008-04-28 14:18:29 +00:00
Neil Roberts
eff57a1cb0 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
Emmanuele Bassi
0d6530e434 2008-04-09 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/Makefile.am: Update the regular expression to match
	all the namespaces we actually use. Thanks to Neil Roberts for
	spotting this. A make distclean is needed.

	* clutter/cogl/gl/Makefile.am:
	* clutter/cogl/gles/Makefile.am:
	* clutter/json/Makefile.am:
	* clutter/pango/Makefile.am: Revert previous commit.
2008-04-09 14:18:42 +00:00
Emmanuele Bassi
f47f85c7f7 2008-04-09 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/cogl/Makefile.am:
	* clutter/cogl/gl/Makefile.am:
	* clutter/cogl/gles/Makefile.am:
	* clutter/json/Makefile.am:
	* clutter/pango/Makefile.am: Fix the visibility of all the
	symbols, for the main library and the statically linked ones.
2008-04-09 13:27:00 +00:00
Neil Roberts
f9039e53cb 2008-03-25 Neil Roberts <neil@o-hand.com>
Added a native Win32 WGL backend.

	* configure.ac: Added the 'win32' flavour.

	* clutter/cogl/gl/cogl.c (cogl_get_proc_address): Added an ifdef
	to use wglGetProcAddress with the Win32 backend.

	* clutter/Makefile.am (DIST_SUBDIRS): Added the win32 directory.

	* clutter/win32/clutter-win32.pc.in:
	* clutter/win32/clutter-win32.h: 
	* clutter/win32/clutter-stage-win32.h: 
	* clutter/win32/clutter-stage-win32.c: 
	* clutter/win32/clutter-event-win32.c: 
	* clutter/win32/clutter-backend-win32.h: 
	* clutter/win32/Makefile.am:
	* clutter/win32/clutter-backend-win32.c: New files.
2008-03-25 15:42:50 +00:00
Matthew Allum
4e147c8843 2008-02-03 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-shader.c:
        Minor formatting cleanups to fit in 80 cols.

        * clutter/clutter-texture.c:
        More safety checks, clean ups in clutter_texture_new_from_actor()

        * clutter/cogl/gl/cogl.c:
        Always clear the FBO initially when rendering

        * tests/test-fbo.c:
        Overhall the test as to be more useful (and show current issues)
2008-02-03 01:53:10 +00:00
Matthew Allum
b97c326eca 2008-02-01 Matthew Allum <mallum@openedhand.com>
* clutter/cogl/cogl.h:
        * clutter/cogl/gl/cogl.c:
        * clutter/cogl/gles/cogl.c:
       Disable the depth test and buffer as has some strange side
       effects, mainly on x/y axis rotation with multiple layers at
       same depth (eg rotating text on a bg has very strange
       effect). Seems no clean 100% effective way to fix without other
       odd issues.. So for now move to application to handle and add
       cogl_enable_depth_test() as for custom actors (i.e groups) to
       enable if need be.
2008-02-01 18:14:54 +00:00
Matthew Allum
307a18860c 2008-02-01 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-feature.h:
        * clutter/clutter-texture.c:
        * clutter/clutter-texture.h:
        * clutter/cogl/cogl.h:
        * clutter/cogl/gl/cogl.c:
        * clutter/cogl/gles/cogl.c:
        * tests/Makefile.am:
        * tests/test.fbo.c:
        Add initial support for FBO's in Clutter (OpenGL only so far).
        See new clutter_texture_new_from_actor()
        Initial implementation, needs work.

        * clutter/x11/clutter-stage-x11.c:
        (clutter_stage_x11_set_cursor_visible):
        Fall back to again not relying on xfixes to hide cursor. *sigh*

        * clutter/clutter-deprecated.h:
        Add clutter_group_find_child_by_id
2008-02-01 15:29:00 +00:00
Emmanuele Bassi
801d55621e 2008-01-16 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/cogl/cogl.h: Rename COGLhandleARB to COGLhandle.

	* clutter/cogl/gl/cogl-defines.h.in:
	* clutter/cogl/gl/cogl.c: Update GL implementation of COGL.

	* clutter/cogl/gles/cogl-defines.h:
	* clutter/cogl/gles/cogl.c: Update GLES implementation of COGL.

	* clutter/clutter-shader.c: Fix ClutterShader to use the new
	COGLhandle type instead of COGLhandlerARB.
2008-01-16 10:38:05 +00:00
Emmanuele Bassi
682eb3c6db 2008-01-14 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/cogl/gl/cogl.c (cogl_get_proc_address): Implement non-GLX
	version using GModule and looking up the symbol from the running
	process. It should work when linked to library providing the
	requested function. (#696, Tommi Komulainen)
2008-01-14 11:52:04 +00:00
Øyvind Kolås
37af2da410 Added COGLhandleARB since the underlying type on OSX is void*,
patch from Tommi Komulainen <tommi.komulainen@iki.fi>, (#694)
* clutter/cogl/gl/cogl-defines.h.in: Added COGLhandleARB typedef.
* clutter/cogl/cogl.h:
* clutter/cogl/gl/cogl.c:
* clutter/clutter-shader.c: Use COGLhandleARB instead of COGLint when
referring to program or shader handles.
2008-01-10 09:55:44 +00:00
Emmanuele Bassi
471da532a3 2007-12-24 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/cogl/cogl.h: Update cogl_clip_set() to accept the
	clip components as ClutterFixed values

	* clutter/cogl/gl/cogl.c (cogl_clip_set): Update the GL implementation
	of cogl_clip_set()

	* clutter/cogl/gles/cogl.c:
	(cogl_rectangle_internal): Provide an internal, inlined rectangle
	drawing	function using fixed point values, to be shared by
	cogl_clip_set() and cogl_rectangle()

	(cogl_clip_set), (cogl_rectangle): Update the GLES implementation
	of cogl_clip_set() and cogl_rectangle() to use the new internal
	rectangle drawing function

	* clutter/clutter-actor.c: Make the clip an array of ClutterUnit
	values instead of pixel-based; this allows higher precision and
	device independence

	(_clutter_actor_apply_modelview_transform): Pass the clip
	components converting from units to fixed point values, using
	the new cogl_clip_set() signature

	(clutter_actor_get_property), (clutter_actor_set_clip),
	(clutter_actor_get_clip): Update the accessors of the clip
	property
2007-12-24 12:53:04 +00:00
Tomas Frydrych
0e391f1194 2007-12-19 Tomas Frydrych <tf@openedhand.com>
* clutter/Makefile.am:
	* clutter/cogl/gl/cogl-defines.h.in:
	* clutter/pango/pangoclutter-render.c:
	* configure.ac:
	Fixes to allow cross-compilation with mingw (patch by Neil
	Roberts).
	Removed trailing whitespace.
2007-12-19 16:16:10 +00:00
Matthew Allum
530fca4b87 2007-12-14 Matthew Allum <mallum@openedhand.com>
* clutter/cogl/gl/cogl-defines.h.in:
        * clutter/cogl/gles/cogl-defines.h:
        Add CLUTTER_COGL_HAS_GL/GLES defines
2007-12-14 12:36:45 +00:00
Øyvind Kolås
4dea166d53 Support for shaders in clutter. At the moment limited to drivers
providing GLSL support.
* clutter/cogl/cogl.h: added rather direct binding of needed for glsl
shaders.
* clutter/cogl/gl/cogl-defines.h.in:
* clutter/cogl/gl/cogl.c:
* clutter/cogl/gles/cogl-defines.h: added stubs.
* clutter/cogl/gles/cogl.c: added stubs.
* clutter/glx/clutter-stage-glx.c:
(clutter_stage_glx_realize): unrelated memory management sanity fix.
(clutter_stage_glx_unrealize): unbind all shaders on stage unrealize.
* clutter/Makefile.am: added clutter-shader.[ch]
* clutter/clutter-actor.[ch]: adding shader capability to 
actors.
* clutter/clutter-feature.h: added CLUTTER_FEATURE_SHADERS_GLSL
* clutter/clutter-private.h: added stack of shaders to context.
* clutter/clutter-shader.[ch]: new.
* tests/Makefile.am: added shader test.
* tests/test-shader.c: (frame_cb), (main): simple shader test,
cycle through the inline shader with right/left mouse buttons.
2007-12-03 16:29:18 +00:00
Emmanuele Bassi
9de04774d2 2007-11-21 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/cogl/cogl.h: Add cogl_fog_set() abstracting the
	glFog() functions and enabling the GL_FOG flag.

	* clutter/cogl/gl/cogl.c: Add GL implementation of cogl_fog_set().
	
	* clutter/cogl/gles/cogl.c: Add GL/ES implementation of
	cogl_fog_set().

	* clutter.symbols: Add new symbols.

	* clutter/clutter-stage.h: Add API to enable depth cueing on
	the stage using a linear GL fog, and to set the parameters
	for it (#637).

	* clutter/clutter-stage.c (clutter_stage_paint): Enable the
	GL fog if the ClutterStage:use-fog property is true.

	* tests/test-depth.c: Test the new stage API.
2007-11-21 11:55:26 +00:00
Emmanuele Bassi
f274e9abb3 2007-10-29 Emmanuele Bassi <ebassi@openedhand.com>
* configure.ac:
	* clutter/cogl/gl/cogl-defines.h.in: The OS X backend has a funny
	OpenGL header location, so it basically did break every application
	including clutter/cogl.h because the GL header inclusion depended
	on symbols defined into Clutter's config.h. Now, we define the
	GL header into the configure template and use it to create the
	cogl-defines.h file cogl.h includes.
2007-10-29 16:50:34 +00:00
Matthew Allum
4ff00fa191 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)
2007-10-26 22:06:45 +00:00
Tomas Frydrych
63ed3a309c 2007-10-15 Tomas Frydrych <tf@o-hand.com>
* clutter/cogl/gl/cogl-defines.h:
	* clutter/cogl/gl/cogl.c:
	Fixed up GL include for windows.
2007-10-15 19:19:42 +00:00
Tomas Frydrych
356678ab3c 2007-10-12 Tomas Frydrych <tf@o-hand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-backend.c:
        * clutter/clutter-behaviour-depth.c:
        * clutter/clutter-box.c:
        * clutter/clutter-clone-texture.c:
        * clutter/clutter-container.c:
        * clutter/clutter-entry.c:
        * clutter/clutter-feature.c:
        * clutter/clutter-fixed.c:
        * clutter/clutter-group.c:
        * clutter/clutter-hbox.c:
        * clutter/clutter-label.c:
        * clutter/clutter-layout.c:
        * clutter/clutter-media.c:
        * clutter/clutter-rectangle.c:
        * clutter/clutter-score.c:
        * clutter/clutter-script.c:
        * clutter/clutter-stage.c:
        * clutter/clutter-texture.c:
        * clutter/clutter-timeline.c:
        * clutter/clutter-timeout-pool.c:
        * clutter/clutter-vbox.c:
        * clutter/cogl/gl/cogl.c:
        * clutter/cogl/gles/cogl.c:
        * clutter/eglnative/clutter-backend-egl.c:
        * clutter/eglnative/clutter-event-egl.c:
        * clutter/eglnative/clutter-stage-egl.c:
        * clutter/eglx/clutter-backend-egl.c:
        * clutter/eglx/clutter-event-egl.c:
        * clutter/eglx/clutter-stage-egl.c:
        * clutter/glx/clutter-event-glx.c:
        * clutter/json/json-array.c:
        * clutter/json/json-generator.c:
        * clutter/json/json-node.c:
        * clutter/json/json-object.c:
        * clutter/json/json-parser.c:
        * clutter/sdl/clutter-backend-sdl.c:
        * clutter/sdl/clutter-event-sdl.c:
        * clutter/sdl/clutter-stage-sdl.c:

	Fixedup config.h inclusion (must always be bracketed with #ifdef
	HAVE_CONFIG_H).
2007-10-12 08:17:00 +00:00
Matthew Allum
fe4fb91fa3 2007-08-13 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-event.c:
        * clutter/clutter-event.h:
        * clutter/clutter-main.c:
        * clutter/clutter-main.h:
        * clutter/clutter-private.h:
        * clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
        * clutter/clutter-types.h:
        Initial implementation of actors emmitting event signals (423);
        - Actors set_reactive() to receive mouse events.
          (call clutter_enable_motion_events() for per action motion events)
        - clutter_stage_set_key_focus () to direct key events.
        - Events bubble up to parents (ending at stage)
          (original source identified by clutter_event_get_source())
        TODO:
        - enter/leave notifys for actors.
        - stage specific events - fullscreen
        - grabs

        * tests/test-events.c:
        Extend a little to use new API

        * clutter/cogl/gl/cogl.c:
        * clutter/glx/clutter-backend-glx.c:
        Move get_proc_address into cogl and out of backend.
        (shaders will need it)

        * clutter/clutter-group.c: (clutter_group_real_lower):
        Fix a minor compile warning.

        * TODO:
        Sync up.
2007-08-13 20:48:01 +00:00