Results 1 to 6 of 6

Thread: Cannot run Basic2D example with GL1

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Serf
    Join Date
    Nov 2009
    Posts
    2

    Default Cannot run Basic2D example with GL1

    Hi, I'm trying to run the Basic2D example. I modified the makefile to use ClanGL1 instead of ClanGL, and also edited the appropriate define inside the source file. When I try to run, I get this error:

    [dorkfish@juggernaut Basic2D]$ ./basic2d
    Exception caught: Invalid texture unit index in GL1 target
    #0 CL_System::capture_stack_trace(int, int, void**, unsigned int*) (/usr/lib/libclan21Core-2.1.so.1)
    #1 CL_Exception::CL_Exception(CL_StringContainer<char , CL_StringReference<char, std::string>, std::string> const&) (/usr/lib/libclan21Core-2.1.so.1)
    #2 CL_GL1GraphicContextProvider::set_primitive_textur e(int, CL_PrimitivesArrayData::VertexData&, int, int, int) (/usr/lib/libclan21GL1-2.1.so.1)
    #3 CL_GL1GraphicContextProvider::draw_primitives_arra y(CL_PrimitivesType, int, int) (/usr/lib/libclan21GL1-2.1.so.1)
    #4 CL_GL1GraphicContextProvider::draw_primitives(CL_P rimitivesType, int, CL_PrimitivesArrayData const*) (/usr/lib/libclan21GL1-2.1.so.1)
    #5 CL_GraphicContext::draw_primitives(CL_PrimitivesTy pe, int, CL_PrimitivesArray const&) (/usr/lib/libclan21Display-2.1.so.1)
    #6 CL_SpriteRenderBatch::flush(CL_GraphicContext&) (/usr/lib/libclan21Display-2.1.so.1)
    #7 CL_GraphicContext_Impl::flush_batcher(CL_GraphicCo ntext&) (/usr/lib/libclan21Display-2.1.so.1)
    #8 CL_GraphicContext::set_program_object(CL_StandardP rogram) (/usr/lib/libclan21Display-2.1.so.1)
    #9 CL_Draw::box(CL_GraphicContext&, float, float, float, float, CL_Colorf const&) (/usr/lib/libclan21Display-2.1.so.1)
    #10 (./basic2d [0x804a983])
    #11 (./basic2d [0x804b69f])
    #12 main (/usr/lib/libclan21App-2.1.so.1)
    #13 __libc_start_main (/lib/libc.so.6)
    #14 (./basic2d [0x804a271])

    I have clanlib compiled with debug symbols enabled, I can get whatever debug info is needed.

    Edit: I was able to get it to build using ClanGDI. I'd still like to know what's up with the error, though, because I'd like to use OpenGL in the project I'm working on.
    Last edited by dorkfish; 11-04-2009 at 02:27 AM.

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

    Default

    In the Basic2D example (Using the GL1 target)

    Can you try the following:

    After the line:
    CL_DisplayWindow window("ClanLib Basic2D Example", 640, 480);

    Add this code:

    Code:
    		CL_GraphicContext_GL1 gc1 = window.get_gc();
    		CL_String str( cl_format("get_max_texture_coords = %1", gc1.get_max_texture_coords() ));
    		CL_Console::write_line(str);
    		return 0;
    It is expected get_max_texture_coords equals 8

  3. #3
    Serf
    Join Date
    Nov 2009
    Posts
    2

    Default

    Nope, it doesn't. Here's the output.

    [dorkfish@juggernaut Basic2D]$ ./basic2d
    get_max_texture_coords = 2

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

    Default

    Sounds like a bug somewhere in the GL1 target

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

    Default

    The problem is caused by:

    int CL_SpriteRenderBatch::set_batcher_active(CL_Graphi cContext &gc, const CL_Texture &texture)

    Currently, it is hard coded to use 4 textures for batch drawing.

    Ideally, it should use 4 or gc.get_max_texture_units() if lower ... but that function does not exist.

    At the moment, I do not know if we should do that?

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

    Default

    Fixed in the http://www.rtsoft.com/forums/showthread.php?p=11887 package (or SVN if you prefer)

Similar Threads

  1. does anyone know how to build SDL for use with clanlib?
    By babyvegas in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 05-29-2009, 03:07 PM
  2. Problems with linux build
    By sphair in forum Official ClanLib SDK Forums
    Replies: 8
    Last Post: 05-29-2009, 07:49 AM
  3. Build System ?
    By zyklo in forum Official ClanLib SDK Forums
    Replies: 10
    Last Post: 09-22-2008, 02:00 PM
  4. OS X Leopard build problem
    By yogi183 in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 12-19-2007, 08:21 AM
  5. Can't build configure.dsw
    By Angew in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 12-06-2006, 09:43 AM

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
  •