Jump to content

  • Log In with Google      Sign In   
  • Create Account

AhmedSaleh

Member Since 27 Nov 2001
Offline Last Active Mar 24 2014 03:18 AM

#5138231 Drawing a singular (or selection of) pixel(s) onto a screen using SDL2

Posted by AhmedSaleh on 11 March 2014 - 04:07 PM

You need to access the surface's pixel, it's called framerbuffer in computer graphics term. It's visualized as a 2D Array, where the bits per pixels define how many bytes per pixel, so consider an 24bit, RGB colored framebuffer then each channel is one byte.

 

pseudo code from my software rendering library test

SDL_Surface *screen = SDL_SetVideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, 32, SDL_HWSURFACE);
graphics.InitFrameBuffer((uint32_t*)screen->pixels, WINDOW_WIDTH, WINDOW_HEIGHT);



#4865742 3D Movement

Posted by AhmedSaleh on 25 September 2011 - 04:51 AM

Thanks All.
I've managed to solve it.


PARTNERS