Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Accessing RGB of rendered graphics  (Read 1852 times)

0 Members and 1 Guest are viewing this topic.

JB_VXR

  • Newbie
  • *
  • Posts: 3
    • View Profile
Accessing RGB of rendered graphics
« on: August 04, 2009, 01:11:49 pm »
Hi there,

I'm new here, pleasure to be here.

I have hopefully a simple question.  If I use SFML in my project, can I render to a 'back buffer' that isn't the window and then access the RGB array of what I rendered?  Preferably the entire array at once rather than any kind of GetPixel(x, y) as it needs to be as fast as possible.

Also, I would be needing to do this in software as I can't guarantee that a graphics card would be present so OpenGL is out.

Thanks in advance,
JB.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Accessing RGB of rendered graphics
« Reply #1 on: August 04, 2009, 01:36:22 pm »
There's no solution that doesn't use OpenGL. In fact the window and graphics modules of SFML are entirely based on OpenGL, so you won't be able to use them at all if no OpenGL driver is present.

But you can manage to get OpenGL everywhere:
- Windows has one by default
- There are software implementations on Linux (see Mesa3D)
- Don't know about Mac OS X
Laurent Gomila - SFML developer

JB_VXR

  • Newbie
  • *
  • Posts: 3
    • View Profile
Accessing RGB of rendered graphics
« Reply #2 on: August 04, 2009, 01:48:09 pm »
Thanks for the information.

I've tried Mesa3D to see OpenGL software rendering in action. Unfortunately it seemed to be running slower than a java equivalent using standard java libraries, though I'm not sure why.

Are there are other 2D software renderer libraries you are aware of that use only the CPU without requiring access to further drivers such as OpenGL.dll etc?  Is SDL similar to SFML in this regard?

Thanks for your help again. Much appreciated.
JB.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Accessing RGB of rendered graphics
« Reply #3 on: August 04, 2009, 01:54:55 pm »
I think SDL would be perfect for that. Just make sure it is fast enough for what you want to do.
Laurent Gomila - SFML developer

JB_VXR

  • Newbie
  • *
  • Posts: 3
    • View Profile
Accessing RGB of rendered graphics
« Reply #4 on: August 04, 2009, 01:57:05 pm »
Thanks for your advice. If I get time, I'll post up some comparisons for future readers.

Cheers,
JB.