Results 1 to 6 of 6

Thread: GL1 CL_BlendMode Problem

  1. #1

    Default GL1 CL_BlendMode Problem

    Hi all, I've a problem using GL1. I'm using last SVN version of ClanLib.

    In CL_BlendMode.cpp:

    Code:
    CL_BlendMode_Impl()	:
    	  src_func(cl_blend_src_alpha),	  dest_func(cl_blend_one_minus_src_alpha),
    	  src_alpha_func(cl_blend_one), 
    	  dest_alpha_func(cl_blend_one_minus_src_alpha),
    	  color_equation(cl_blend_equation_add),
    	  alpha_equation(cl_blend_equation_add),
    	  blend_color(CL_Colorf(1.0f,1.0f,1.0f)), blending_enabled(true)+
    In GL1 set_blend_mode():
    Code:
    if( mode.get_blend_function_src() == mode.get_blend_function_src_alpha() &&
    		mode.get_blend_function_dest() == mode.get_blend_function_dest_alpha() )
    	{
    		if (cl1BlendFunc)
    			cl1BlendFunc(to_enum(mode.get_blend_function_src()), to_enum(mode.get_blend_function_dest()));
    	}
    	else
    	{
    		throw CL_Exception(cl_text("BlendFuncSeparate is not supported for OpenGL 1.3"));	}
    src_func != src_alpha_func and in GL1 this causes an exception when I create CL_DisplayWindow().

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Unless you need 2.2, I would recommend using 2.1 for now.

    ClanLib 2.1.1 should be released soon (in the next couple of days)

    It'll be a while before ClanLib 2.2 is released, and it is unstable at the moment.

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    ClanLib 2.2 is the playground for developing the next version of clanlib, where the API is modified.

    ClanLib 2.1 contains patches for the last release of ClanLib 2.1.x .The API is stable and will not change (Unless there are show-stopping bugs with the relevant function)

    I plan to maintain ClanLib 2.1 until ClanLib 2.2 is released and stable (I would think this would be in late 2010, but just a guess)

  4. #4
    Master Sorcerer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    I changed the default blending mode in ClanLib because transparency calculations are not correct unless the target texture/buffer is in a pre-multiplied alpha format. This is crucial for getting the texture window manager to operate correctly when using translucent graphics.

    Unfortunately (as you noticed) it requires a certain OpenGL function which was standardized in OpenGL 1.5 (2003) and apparently the GL1 target does not target 1.5.

    This leaves us with the following options:

    • Check if the shitty Intel chip drivers at least support the extension that OpenGL 1.5 standardized. If it does, we can simply require that one for GL1 to run.
    • Change all sprites and images to always upload to textures in pre-multiplied alpha format. Such textures do not need a special rule for the alpha blending.
    • Drop support for cards not supporting OpenGL 1.5. This would make the GL1 target pointless because only the shitty Intel mega corp cannot afford to build drivers for a "modern" OpenGL (modern = 2003)...

  5. #5
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    A quick hack committed to SVN

    - throw CL_Exception(cl_text("BlendFuncSeparate is not supported for OpenGL 1.3"));
    + // TODO: Fixme !
    + //throw CL_Exception(cl_text("BlendFuncSeparate is not supported for OpenGL 1.3"));
    + if (cl1BlendFunc)
    + cl1BlendFunc(to_enum(mode.get_blend_function_src() ), to_enum(mode.get_blend_function_dest()));

  6. #6

    Default

    Thank you for your advice and your useful informations!

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •