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

Author Topic: RenderWindow only displaying one object  (Read 2411 times)

0 Members and 2 Guests are viewing this topic.

Knucklehead

  • Newbie
  • *
  • Posts: 19
    • View Profile
RenderWindow only displaying one object
« on: March 16, 2015, 03:31:08 am »
hey,

So my current issue is after running a sfe::Movie something internally in SFML is switched to only render one object per sf::RenderWindow::display() function and specifically its the render object that was called last. Any ideas? thank you for your time. Could it be the RenderTarget needs glResetStates(); if so, is there a function that returns all RenderTargets currently active?
« Last Edit: March 16, 2015, 03:47:16 am by Knucklehead »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10998
    • View Profile
    • development blog
    • Email
AW: RenderWindow only displaying one object
« Reply #1 on: March 16, 2015, 07:44:51 am »
There's no such thing. Do you actually draw multiple objects within a clear() display() block?
If you don't draw sfeMovie does it render the objects?
Do you draw the other objects before or aftrr sfeMovie renders the video?

Provide a minimal anx compilable example code that reproduces the issue.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Knucklehead

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: RenderWindow only displaying one object
« Reply #2 on: March 16, 2015, 07:58:20 am »
The code involved in this is between multiple states so it is quite extensive, but what I can do is create a youtube video of the exact problem.

the flow is

-create movie

-update movie

-draw movie

-window display

-loop above

-when movie is finished switch states

-start drawing objects for the scene in modern openGL

-window display()


if I dont play a movie and just render my scene it works perfectly if I call the movie then after the movie is finished start rendering my scenes only the last object on the stack gets rendered.

because Im rendering the video with sfml then moving back to modern GL i know there is some upkeep with the states you have to do and I feel like that is the cause of the issue, when switching from sfml back to openGL rendering what should I do for the window openGL states? when switching from openGL to sfml what should I do with the states
« Last Edit: March 16, 2015, 08:07:24 am by Knucklehead »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10998
    • View Profile
    • development blog
    • Email
AW: RenderWindow only displaying one object
« Reply #3 on: March 16, 2015, 08:13:16 am »
Well if you display your window twice, then you'll only end up with the renderings of the last display will be drawn.
Where do you clear the screen?

Yes, you need to manage the OpenGL states. SFML can handle the legacy OpenGL states itself (see the OpenGL tutorial), but you'll have to set and reset modern OpenGL states yourself.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Knucklehead

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: RenderWindow only displaying one object
« Reply #4 on: March 16, 2015, 08:16:06 am »
https://www.youtube.com/watch?v=KXBH5vVbYSo&feature=youtu.be


heres the youtube video of whats going on.

in the video i load the main menu then exit the program.

then I load the video state once the video is finished my state switches to the main menu.

but this time the main menu is only rendering one object the background which happen to be the last call on the draw stack.

Knucklehead

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: RenderWindow only displaying one object
« Reply #5 on: March 16, 2015, 06:58:19 pm »
Fixed it by glEnable(GL_DEPTH_TEST);

 

anything