Jump to content

  • Log In with Google      Sign In   
  • Create Account


Tolito

Member Since 16 Jun 2012
Offline Last Active Apr 19 2014 11:23 PM
-----

Posts I've Made

In Topic: UDP - Returning data.

18 April 2014 - 09:54 PM

Thanks! It is the same thing in general. It is simply a matter of storing the sockaddr information and updating it for sendto, the SDL_net version. Thanks!


In Topic: SDL 2.0 - Edit Renderer Pixels

03 February 2014 - 08:03 AM

Thanks! Hopefully others with this question will come across this post!


In Topic: SDL 2.0 - Edit Renderer Pixels

31 January 2014 - 04:32 PM

Update:

 

For my new multiplication function, I simply did this:

    SDL_Rect r={0,0,XRES,YRES};
    SDL_SetRenderDrawBlendMode(screen,SDL_BLENDMODE_MOD);
    FillRect(screen,&r,color);
This multiplies the new color to the screen without the need for accessing and editing the screen pixels, multiplying to them one by one. Since this is why I was needing to access the renderer pixels, this is no longer a problem.

In Topic: SDL 2.0 - Edit Renderer Pixels

31 January 2014 - 04:10 PM

Thanks again! Since no pixel representation can be found, it sounds like my idea of storing said pixels as an SDL_Surface after they have been copied to the renderer is not a possibility. The only efficient possibility for doing this may be copying the to-be-blitted region of each texture, multiplying to the copy, rendering the copy to the SDL_Renderer, and destroying the copy. Doing this effectively is all over my head, though. Should I keep using SDL_Surfaces for everything and do the multiplication and rendering there, then storing as a texture and rendering that to the renderer at whatever scale?


In Topic: SDL 2.0 - Edit Renderer Pixels

31 January 2014 - 03:20 PM

Thanks for the reply! Actually, I am using SDL_RenderCopy to copy textures to the screen, which is of type SDL_Renderer. Instead of updating every texture each frame, I want to edit the pixels of the renderer itself, basically the final version of the screen. I am trying to avoid using an SDL_Surface since this will be calculated each frame and I want to do all of this in the GPU. Creating a surface that is a copy of the renderer, multiplying the colors there, converting the surface to a texture, and using SDL_RenderCopy again to put the edited colors back on the renderer would work, but it seems like there is a more efficient way of doing that. Is there a way to access and edit the pixels of an SDL_Renderer itself? Thanks again!


PARTNERS