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

Author Topic: [SOLVED] Very long rendering C-SFML / CAML-LIGHT  (Read 2058 times)

0 Members and 1 Guest are viewing this topic.

hilnius

  • Newbie
  • *
  • Posts: 2
    • View Profile
[SOLVED] Very long rendering C-SFML / CAML-LIGHT
« on: October 28, 2012, 02:48:43 am »
Hi,
Im using the CSFML binding and caml-light on a project, and i'd like to know whi it takes 0.3 seconds to render 12*18=216 sprites.
if this update time is normal then how to update just a part of the window ?

thanks
hilnius
« Last Edit: October 28, 2012, 07:23:11 pm by hilnius »

hilnius

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Very long rendering C-SFML / CAML-LIGHT
« Reply #1 on: October 28, 2012, 07:22:46 pm »
finallt, that was something stupid : i'm running on a VM that does not use my graphic card.

7krs

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • Email
Re: [SOLVED] Very long rendering C-SFML / CAML-LIGHT
« Reply #2 on: October 28, 2012, 11:20:02 pm »
how to update just a part of the window ?

Well I found that you can update just part of the window by simply drawing over it without clearing:
You could basically "clear" parts using sf::RectangleShape or even sf::CircleShape of your desired size and colour.

EDIT: read Laurent's comments in the posts beneath. This method is "not reliable".
« Last Edit: October 29, 2012, 12:17:17 pm by 7krs »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [SOLVED] Very long rendering C-SFML / CAML-LIGHT
« Reply #3 on: October 29, 2012, 07:58:19 am »
Quote
Well I found that you can update just part of the window by simply drawing over it without clearing:
You could basically "clear" parts using sf::RectangleShape or even sf::CircleShape of your desired size and colour.
Wrong. Never do that ;)
Laurent Gomila - SFML developer

7krs

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • Email
Re: [SOLVED] Very long rendering C-SFML / CAML-LIGHT
« Reply #4 on: October 29, 2012, 09:49:43 am »
But why Laurent? It worked for me and I never got any memleaks, could you explain why it is wrong to do so?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [SOLVED] Very long rendering C-SFML / CAML-LIGHT
« Reply #5 on: October 29, 2012, 10:08:47 am »
You shouldn't expect pixels rendered previously to be valid in the current frame. For example, with double-buffering, you would get the pixels rendered two frames ago.

It might work in certain circumstances, but it's not clean/reliable. And it's not necessary.
« Last Edit: October 29, 2012, 10:10:26 am by Laurent »
Laurent Gomila - SFML developer

 

anything