Results 1 to 2 of 2

Thread: Drawing error primitves

  1. #1
    Join Date
    Feb 2010

    Default Drawing error primitves

    this code doesn't complie at all and yet it's given in the link

    CL_Vec4f red_color(1.0f, 0.0f, 0.0f, 1.0f);
    CL_Vec4f green_color(0.0f, 1.0f, 0.0f, 1.0f);

    CL_Vec2i positions[] = { CL_Vec2i(10,10), CL_Vec2i(100,100) };
    CL_Vec4f colors[] = { red_color, green_color };

    CL_PrimitivesArray vertices(gc);
    vertices.set_attribute(0, positions);
    vertices.set_attribute(1, colors);

    gc.draw_primitives(cl_lines, 2, vertices);

    errors are in the bold lines. for first to lines:
    Reason: cannot convert from 'CL_Vec2i [2]' to 'const CL_Vec1ub'

    for the last, there is no such member called 'set_program'!

    I installed clanlib 2.1.1 in VS2008 and using gl1. Please someone respond me with a fix

  2. #2
    Master Sorcerer
    Join Date
    Sep 2006


    The two first errors is because the function name should be set_attributes and not set_attribute. The last function is called set_program_object and not set_program.

Similar Threads

  1. Drawing differences when using CL_GUIManager*
    By genail in forum Official ClanLib SDK Forums
    Replies: 6
    Last Post: 12-12-2009, 07:37 AM
  2. Replies: 5
    Last Post: 07-06-2009, 01:35 PM
  3. Drawing and Erasing Surfaces
    By jmguy02 in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 04-07-2009, 05:32 AM
  4. Drawing pixels
    By knutsj in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 06-17-2008, 11:43 PM
  5. Redirect GUI drawing?
    By madmark in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 10-06-2007, 04:25 AM



Posting Permissions

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