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.


Topics - fatess

Pages: [1]
1
Graphics / How to optimize multiple draws
« on: May 21, 2021, 05:05:12 am »
Hi,
I'm working on a cellular automaton and I have to print a grid of cells with sfml.
It's working fine when cells are about less than 600, but when the grid gets bigger, the 600+ draw function calls really slow down the software. Is there any way to make it faster?

This is the problematic part of the code: the vector can contain up to 518400 elements, and with 600 it already starts to take some time to draw all.

Quote
           automatonWindow.clear()
           for(Person currentPerson : *evolutionIterator){
                //Set cell color according to it's status
                personCell.setPosition(x, y);
                automatonWindow.draw(personCell);
            }
            automatonWindow.display()
           

2
Graphics / Window in tutorial code doesn't close (+ openGL error)
« on: April 24, 2021, 02:20:51 pm »
Hi, I'm using ubuntu 20.04 on windows, and I was following the linux tutorial at this link:
https://www.sfml-dev.org/tutorials/2.5/start-linux.php
The problem is: when I try to run the code in that tutorial the window doesn't close if I try to close it unless I remove the "window.display();" function from the code. If I do so, the window is black and I can close it.
Plus, the following text appear as standard output:

Quote
Failed to enable udev monitor, joystick connections and disconnections won't be notified: -22
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 1.1 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
Created: version = 0.0 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
Setting vertical sync failed
sfml-graphics requires support for OpenGL 1.1 or greater
Ensure that hardware acceleration is enabled if available

How can I solve this?

Pages: [1]