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

Author Topic: (OpenGL or SFML) doesn't render anythig  (Read 2712 times)

0 Members and 1 Guest are viewing this topic.

editali

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
(OpenGL or SFML) doesn't render anythig
« on: January 12, 2014, 01:55:13 pm »
Hi guys, I have 2 classes, first one is my ScreenHost and second one is ViewController.
ScreenHost creates a ViewController and adds some Graph objects to it, then it waits until DataArived event raised and it calls Render() method on ViewController.
The problem is ViewController doesn't show anything, it just shows a white screen while the Render() method runs properly! But when I call Render() right after constructor it draws my shapes.
Here's my code (summerized):

////////////////////////////////////////////
/////// ScreenHost.SetScreen()
////////////////////////////////////////////
        public void SetScreen()
        {
            vc = new ViewController(800,  600, Rows, Cols);
            ...
            // If i call  vc.Render() it works
        }


////////////////////////////////////////////
/////// ScreenHost.DataArived  event
////////////////////////////////////////////

        void DataArived ()
        {
            // it runs Render() but doesn't show anything except a white screen (Render clears screen with black color)
            vc.Render();
        }


////////////////////////////////////////////
/////// ScreenHost.DataArived  event
////////////////////////////////////////////

        public void Render()
        {
            // it clears screen with black color
            renderWindow.Clear(Color.Black);
        }

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: (OpenGL or SFML) doesn't render anythig
« Reply #1 on: January 12, 2014, 02:14:27 pm »
Please read the forum rules, you're doing several things wrong: Wrong forum, unclear description, no minimal/complete example, lot of custom code unknown to us, no code tags.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything