Results 1 to 2 of 2

Thread: [2.7.3] SWRender patch to handle cl_line_strip

  1. #1

    Default [2.7.3] SWRender patch to handle cl_line_strip

    I was trying to draw some audio waveforms, and then I found that draw_primitives on SWRender does not handle cl_line_strip at all. It's the same on the current 2.7 SVN.

    Code:
    --- a/Sources/SWRender/swr_graphic_context_provider.cpp
    +++ b/Sources/SWRender/swr_graphic_context_provider.cpp
    @@ -265,6 +265,13 @@
     		for (int i = offset; i+1 < end_vertices; i+=2)
     			draw_line(i+0, i+1);
     	}
    +    else if (type == cl_line_strip)
    +    {
    +		int end_vertices = offset+num_vertices;
    +
    +		for (int i = offset; i < end_vertices-1; i++)
    +			draw_line(i, i+1);
    +    }
     	else if (type == cl_line_loop)
     	{
     		int end_vertices = offset+num_vertices;
    @@ -302,6 +309,11 @@
     			for (int i = 0; i+1 < count; i+=2)
     				draw_line(indices[i], indices[i+1]);
     	}
    +    else if (type == cl_line_strip)
    +    {
    +		for (int i = 0; i < count-1; i++)
    +			draw_line(indices[i], indices[i+1]);
    +    }
     	else if (type == cl_line_loop)
     	{
     		int i;
    @@ -334,6 +346,11 @@
     		for (int i = 0; i+1 < count; i+=2)
     			draw_line(indices[i], indices[i+1]);
     	}
    +    else if (type == cl_line_strip)
    +    {
    +		for (int i = 0; i < count-1; i++)
    +			draw_line(indices[i], indices[i+1]);
    +    }
     	else if (type == cl_line_loop)
     	{
     		int i;
    @@ -366,6 +383,11 @@
     		for (int i = 0; i+1 < count; i+=2)
     			draw_line(indices[i], indices[i+1]);
     	}
    +    else if (type == cl_line_strip)
    +    {
    +		for (int i = 0; i < count-1; i++)
    +			draw_line(indices[i], indices[i+1]);
    +    }
     	else if (type == cl_line_loop)
     	{
     		int i;

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

    Default

    Applied patch to ClanLib 2.3 SVN and modified patch to ClanLib 3.0 SVN

    Many thanks

Similar Threads

  1. Problems with NetGame: unable to create socket handle
    By chris91 in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 10-21-2012, 09:39 AM
  2. ClanLib 2.3 Object Handle Inconsistancies
    By rombust in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 05-06-2011, 02:29 AM
  3. SWRender timing problem with new example
    By rombust in forum Official ClanLib SDK Forums
    Replies: 6
    Last Post: 11-01-2010, 08:19 AM
  4. How to handle water
    By mikael in forum Novashell Game Creation System
    Replies: 3
    Last Post: 05-08-2008, 11:15 PM
  5. CL 0.8 Canvas patch, get-rid-of-warnings patch
    By Trigve in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 09-30-2007, 11:08 PM

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
  •