The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
I need vertex buffers
brianhj


Joined: 17 Jan 2010
Posts: 14
I need vertex buffer objects but I HATE opengl. Will SDL ever get this feature? Or is there some way to draw 15,000 lines per frame at 60fps with SDL?
I need vertex buffers
Jonny D


Joined: 12 Sep 2009
Posts: 932
If you don't actually need VBO access, but just want the perf benefit, SDL_gpu can draw plenty of lines (because it does use VBOs to do batching).

https://github.com/grimfang4/sdl-gpu



Jonny D




On Thu, Jan 26, 2017 at 2:22 PM, brianhj wrote:
Quote:
I need vertex buffer objects but I HATE opengl. Will SDL ever get this feature? Or is there some way to draw 15,000 lines per frame at 60fps with SDL?


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: I need vertex buffers
brianhj


Joined: 17 Jan 2010
Posts: 14
Does this work with SDL2? Does it match the performance of OpenGL VBO? If so then yes this is exactly what i need

Thanks!!!


Jonny D wrote:
If you don't actually need VBO access, but just want the perf benefit, SDL_gpu can draw plenty of lines (because it does use VBOs to do batching).

https://github.com/grimfang4/sdl-gpu



Jonny D




On Thu, Jan 26, 2017 at 2:22 PM, brianhj wrote:
Quote:
I need vertex buffer objects but I HATE opengl. Will SDL ever get this feature? Or is there some way to draw 15,000 lines per frame at 60fps with SDL?


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

brianhj


Joined: 17 Jan 2010
Posts: 14
Unfortunately I can't even get a simple program to work:

Code:
#include "SDL.h"
#include "SDL_gpu.h"

void main_loop(GPU_Target* screen) {
   while (true) {
      GPU_Clear(screen);
      GPU_Line(screen, 0.f, 0.f, 123.f, 123.f, SDL_Color({ 123,255,255 }));
      GPU_Flip(screen);
   }
}

int main(int argc, char* argv[])
{
   GPU_Target* screen;

   screen = GPU_Init(800, 600, GPU_DEFAULT_INIT_FLAGS);
   if (screen == NULL)
      return -1;

   main_loop(screen);

   GPU_Quit();

   return 0;
}



Any ideas??? It's just a black screen. I used strange coords and colors to make sure I was sane.
I need vertex buffers
Daniel Gibson
Guest

Your color only has 3 components, the 4th (alpha) might be set to 0
because of this, making the line totally translucent (invisible)?
try something like SDL_Color c = {123, 255, 255, 255}; and use that in
the GPU_Line() call.

Cheers,
Daniel

Quote:


Any ideas??? It's just a black screen. I used strange coords and colors
to make sure I was sane.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: I need vertex buffers
brianhj


Joined: 17 Jan 2010
Posts: 14
If i could buy you a beer i would, i added 255 in there and it worked fine. Thanks buddy Very Happy

Daniel Gibson wrote:
Your color only has 3 components, the 4th (alpha) might be set to 0
because of this, making the line totally translucent (invisible)?
try something like SDL_Color c = {123, 255, 255, 255}; and use that in
the GPU_Line() call.

Cheers,
Daniel

Quote:


Any ideas??? It's just a black screen. I used strange coords and colors
to make sure I was sane.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
I need vertex buffers
Daniel Gibson
Guest

Cool, glad I could help (despite never having used SDL_GPU) :-)

On 27.01.2017 04:08, brianhj wrote:
Quote:
If i could buy you a beer i would, i added 255 in there and it worked
fine. Thanks buddy Very Happy


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: I need vertex buffers
brianhj


Joined: 17 Jan 2010
Posts: 14
If i could buy you a beer i would, i added 255 in there and it worked fine. Thanks buddy Very Happy

Unfortunately performance with line drawing isn't any better than play ol' SDL Sad Sad Sad Very disappointed

Daniel Gibson wrote:
Your color only has 3 components, the 4th (alpha) might be set to 0
because of this, making the line totally translucent (invisible)?
try something like SDL_Color c = {123, 255, 255, 255}; and use that in
the GPU_Line() call.

Cheers,
Daniel

Quote:


Any ideas??? It's just a black screen. I used strange coords and colors
to make sure I was sane.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
I need vertex buffers
Jonny D


Joined: 12 Sep 2009
Posts: 932
What numbers are you getting?

Jonny D


On Thu, Jan 26, 2017 at 10:17 PM, brianhj wrote:
Quote:
If i could buy you a beer i would, i added 255 in there and it worked fine. Thanks buddy

Unfortunately performance with line drawing isn't any better than play ol' SDL Very disappointed




Daniel Gibson wrote:

Your color only has 3 components, the 4th (alpha) might be set to 0
because of this, making the line totally translucent (invisible)?
try something like SDL_Color c = {123, 255, 255, 255}; and use that in
the GPU_Line() call.

Cheers,
Daniel




Quote:



Any ideas??? It's just a black screen. I used strange coords and colors
to make sure I was sane.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: I need vertex buffers
brianhj


Joined: 17 Jan 2010
Posts: 14
Well I have 25 sets of lines, each with 466 lines. That's 11650 lines per frame or 699000 lines per second at 60fps.

SDL + SDL_gpu using GPU_line i get 17 FPS
SDL + OpenGL + VBO i get 60 FPS, capped by monitor i think

I just fucking hate programming in OpenGL. Every little think you need to do is a fucking science project Evil or Very Mad


Jonny D wrote:
What numbers are you getting?

Jonny D


On Thu, Jan 26, 2017 at 10:17 PM, brianhj wrote:
Quote:
If i could buy you a beer i would, i added 255 in there and it worked fine. Thanks buddy

Unfortunately performance with line drawing isn't any better than play ol' SDL Very disappointed




Daniel Gibson wrote:

Your color only has 3 components, the 4th (alpha) might be set to 0
because of this, making the line totally translucent (invisible)?
try something like SDL_Color c = {123, 255, 255, 255}; and use that in
the GPU_Line() call.

Cheers,
Daniel




Quote:



Any ideas??? It's just a black screen. I used strange coords and colors
to make sure I was sane.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I need vertex buffers
Jonny D


Joined: 12 Sep 2009
Posts: 932
If you want to troubleshoot this, we can take it off-list.  On a Macbook Pro, I'm getting 30fps rendering 10x that number of lines (>100,000) each frame.

Jonny D




On Thu, Jan 26, 2017 at 10:40 PM, brianhj wrote:
Quote:
Well I have 25 sets of lines, each with 466 lines. That's 11650 lines per frame or 699000 lines per second at 60fps.

SDL + SDL_gpu using GPU_line i get 17 FPS
SDL + OpenGL + VBO i get 60 FPS, capped by monitor i think

I just fucking hate programming in OpenGL. Every little think you need to do is a fucking science project





Jonny D wrote:

What numbers are you getting?

Jonny D


On Thu, Jan 26, 2017 at 10:17 PM, brianhj <> wrote:



Quote:

If i could buy you a beer i would, i added 255 in there and it worked fine. Thanks buddy

Unfortunately performance with line drawing isn't any better than play ol' SDL Very disappointed




Daniel Gibson wrote:

Your color only has 3 components, the 4th (alpha) might be set to 0
because of this, making the line totally translucent (invisible)?
try something like SDL_Color c = {123, 255, 255, 255}; and use that in
the GPU_Line() call.

Cheers,
Daniel




Quote:



Any ideas??? It's just a black screen. I used strange coords and colors
to make sure I was sane.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org










_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: I need vertex buffers
brianhj


Joined: 17 Jan 2010
Posts: 14
Ok that would be great!!!

Jonny D wrote:
If you want to troubleshoot this, we can take it off-list.  On a Macbook Pro, I'm getting 30fps rendering 10x that number of lines (>100,000) each frame.

Jonny D




On Thu, Jan 26, 2017 at 10:40 PM, brianhj wrote:
Quote:
Well I have 25 sets of lines, each with 466 lines. That's 11650 lines per frame or 699000 lines per second at 60fps.

SDL + SDL_gpu using GPU_line i get 17 FPS
SDL + OpenGL + VBO i get 60 FPS, capped by monitor i think

I just fucking hate programming in OpenGL. Every little think you need to do is a fucking science project





Jonny D wrote:

What numbers are you getting?

Jonny D


On Thu, Jan 26, 2017 at 10:17 PM, brianhj <> wrote:



Quote:

If i could buy you a beer i would, i added 255 in there and it worked fine. Thanks buddy

Unfortunately performance with line drawing isn't any better than play ol' SDL Very disappointed




Daniel Gibson wrote:

Your color only has 3 components, the 4th (alpha) might be set to 0
because of this, making the line totally translucent (invisible)?
try something like SDL_Color c = {123, 255, 255, 255}; and use that in
the GPU_Line() call.

Cheers,
Daniel




Quote:



Any ideas??? It's just a black screen. I used strange coords and colors
to make sure I was sane.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org










_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

brianhj


Joined: 17 Jan 2010
Posts: 14
I just set up a simple test program. I looped through 50000 random lines and i'm only getting 33 fps Sad
I need vertex buffers
Jonny D


Joined: 12 Sep 2009
Posts: 932
That could be a hardware bottleneck?  I'll follow up off-list and we can report back when settled.

Jonny D


On Friday, January 27, 2017, brianhj wrote:
Quote:
I just set up a simple test program. I looped through 50000 random lines and i'm only getting 33 fps

I need vertex buffers
Ed Phillips
Guest

On Fri, 27 Jan 2017, Jonathan Dearborn wrote:

Quote:
That could be a hardware bottleneck?  I'll follow up off-list and we can report back when settled.
Jonny D

That would be great... these kinds of performance cases are interesting to
me.

Thanks,

Ed
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org