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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mk12

Pages: [1]
1
Graphics / Updating part of the screen?
« on: August 03, 2010, 10:02:15 pm »
Ok, I did it in OpenGL with GL_POINTS and it's much better. SFML makes the windowing/input/etc. very easy though :). Thanks for your help.

2
Graphics / Updating part of the screen?
« on: August 03, 2010, 07:42:12 pm »
Ok I tried the one pixel per frame method, but it can only run at ~30 fps. Are you sure drawing the whole image like this is a good idea? It's fullscreen at 1920x1200, so if I did the pixel array thing, that would be 2.3mb copied to the image, then drawn to the window every frame.

BTW I can't use std::vector because I'm using Csfml.

Shoud I just use OpenGL?

3
Graphics / Updating part of the screen?
« on: August 03, 2010, 06:33:05 pm »
Ok, so I have an sfImage and an sfSprite (which has its Image set to my image), and an array likes this : "sfUint8 pixels[ScreenHeight][ScreenWidth]" ? Then every frame I calculate as many points as I want, set their colour in the pixels array, load those into the image,  draw the Sprite into the window?

One question: how come I have to use 1-byte integers? Won't this limit me to 8 bpp color depth?
UPDATE: Just realized it says it assumes RGBA colour. So does this mean my pixels array will have to be malloc(ScreenHeight  * ScreenWidth * 4 * sizeof(sfUint8)) ?

Also, I didn't realize the circles always use 40 points. Why not have SFML calculate how many are necessary?

BTW I'm using csfml 2.0.

4
Graphics / Updating part of the screen?
« on: August 03, 2010, 06:10:24 am »
In my little program, each frame one point is drawn. Updating the whole screen vs one pixel makes a huge difference. In SFML it is really slow because of that and as far as I know I can't set an individual pixel either, so I have to use a circle with a radius of 0.5 (using a shape with a single point didn't seem to work).

I guess I could use OpenGL but I don't see why this kind of thing isn't implemented.

Wait, does SFML Graphics use OpenGL internally? With SDL it went much faster updating only one pixel because otherwise it blits the whole frame, but OpenGL does its own calculations for what parts to update, no?

EDIT: Ok I just realized it's going "slow" because I had it V-synced, drawing only one dot per frame. So I will just draw many times each frame. But is there a way to draw points besides using tiny circles?

What it's doing by the way is this: http://en.wikipedia.org/wiki/Chaos_game .

5
Graphics / Updating part of the screen?
« on: August 03, 2010, 03:05:22 am »
How can I only update a certain part (rect) of the screen, like in SDL ? RenderWindow.Display() doesn't give the option to specify a rect. In SDL doing this sped things up a lot for me, so is there some reason I can't in SFML?

Pages: [1]
anything