#2 setPixel(...) & getPixel(...)

closed
nobody
5
2003-05-27
2003-05-13
No

Hi!

Nice work porting SDL and Open-GL to Erlang. What im
missing though is a simple way of reading and writing a
pixel from/to a surface. Maybe i have missunderstood
how this can be done in a simple way but i havent
succeded. Its simple in c but i dont understand how to
manage it in erlang without making it very costly..

Thanks in Advance!

/Christoffer Vikström
(chvi3471@student.uu.se)

Discussion

    • status: open --> closed
     
  • Logged In: YES
    user_id=20273

    Hi

    Hmm, sorry for the delay I didn't get an email indication on
    the question..

    sdl_video:get_pixels() should be pretty fast for reading.
    To write I think you need to create a new_surface with
    sdl_video:createRGBsurfaceFrom and blit it on another surface.

    I don't really know :-)
    I havn't used sdl_video to other things than creating the
    opengl window :-) and writing the sprite example two years ago.

    I don't know if erlang is fast enough to make updates on a
    pixel level, but
    I havn't tried either..I have always thought it was easier
    to let opengl do the rendering :-)

    If you implement a set/getPixel I can add it :-)
    Regards
    /Dan
    PS: I once was d90dgu @ docs.uu.se

     
  • Logged In: YES
    user_id=20273

    Hi

    Hmm, sorry for the delay I didn't get an email indication on
    the question..

    sdl_video:get_pixels() should be pretty fast for reading.
    To write I think you need to create a new_surface with
    sdl_video:createRGBsurfaceFrom and blit it on another surface.

    I don't really know :-)
    I havn't used sdl_video to other things than creating the
    opengl window :-) and writing the sprite example two years ago.

    I don't know if erlang is fast enough to make updates on a
    pixel level, but
    I havn't tried either..I have always thought it was easier
    to let opengl do the rendering :-)

    If you implement a set/getPixel I can add it :-)
    Regards
    /Dan
    PS: I once was d90dgu @ docs.uu.se