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 - sisms92

Pages: [1]
1
Graphics / Fast Pixel Drawing
« on: February 19, 2010, 01:37:01 pm »
Thanks for all the help, LoadFromPixels is much faster than SetPixel as you said. As for the OpenGL method, I failed at that. Again, the pixel(s) would all render at the same position, dead centre of the screen, and only when I passed glVertex2i 0, 0. Something to look at in the future I guess. For now I'm just happy this works.

Next up, making my mandelbrot as fast as I can and then implementing zooming 8)

Quote from: "OniLink10"
Because of the problem I specified in the Graphics forum. Rendering with sf::Sprite still doesn't work with Win7, not even the RTM. :\ It's just all blank. OpenGL rendering is just fine, though.


Windows 7 seems to render sprites fine for me, by the way. I'm running the 64 Bit Professional edition if it makes a difference.

2
Graphics / Re: Fast Pixel Drawing
« on: February 18, 2010, 03:50:36 pm »
Quote from: "OniLink10"
I use rendering the pixels to an sf::Image and then drawing that through OpenGL. It works REALLY fast, and even old Laptops using the Intel Celeron can generate Mandelbrots pretty quickly using sf::Image with this technique. As in, under 10 seconds. The OpenGL code just involves calling sf::Image's Bind function, then drawing a quad at coordinates (-1.0,-1.0), (-1.0,1.0), (1.0,1.0), (1.0,-1.0), in that order, with proper TexCoords(0 to 1, invert the Y axis(1 for top, 0 for bottom)).


Funnily enough that's what I want to render quicky, a mandlebrot set.

Quote from: "Laurent"

Can you show your code?
Using SetPixel is quite slow, the best solution is to work on your own array of pixels and then update the image with LoadFromPixels (which is optimized for this kind of situations).


I can't access my source code right now, but I'll definitely try the LoadFromPixels method when I can.

Quote from: "Nexus"
You could also use GL_POINTS directly in OpenGL. However, this requires to set up the view and the matrices corresponding to SFML, so that you can use the same coordinate system.


I tried using GL_POINTS a few months back, I completely forgot about it  :) If I remember right, I had a problem with pixels only rendering in the centre of the screen, and that they would only render if the vector I passed had co-ordinates 0, 0. The view and matrices set up might explain that..

Thanks for the input, I'll look using LoadFromPixels and then OpenGL and sum up which is the better way for me to go. I'll let you know how it goes :)

3
Graphics / Fast Pixel Drawing
« on: February 18, 2010, 01:46:56 am »
Hi, I'm trying to set the colour of specific pixels in an sf::RenderWindow. Unfortunately the only way I've found so far is by setting the colour of pixels on an image and then drawing that. This is quite slow, and so I'm looking for alternatives.

Is there any way to do this in SFML2? If not, what would be the equivalent OpenGL code, and how hard would it be to mix SFML2 and OpenGL?

I appreciate any input  :wink:

Pages: [1]