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

Pages: [1]
1
DotNet / Re: Draw background sprite is very slow
« on: December 21, 2013, 10:26:53 am »
Thanks for your code and your advices.
I tried the code and using the devices.png image in the resource folder of the shader example included in the library I scored 29/30 FPS.
I tried to use a png with the portion of the screen I use in my code and the results are 11/12 FPS. I noticed also that the FPS drops a lot if I resize the window with a bigger one and increase a lot if I resize with a small one.
So my conclusion is that... I have to update my gfx card :)

2
DotNet / Re: Draw background sprite is very slow
« on: December 21, 2013, 12:57:09 am »
The Driver is up to date, I already check for update and try to uninstall current driver and installing the last one from AMD site.
The strangest thing is that the performance are very slow even for a gfx card like that, I play game like batman arkham asylum and nverwinter mmorpg so it seems strange that I could not handle 4 texture.

this is the code of my game loop where I count the FPS, the method is simple, every second I count how many loop I've made.

            DateTime start = DateTime.Now;
            Int32 countFps = 0;
            Int32 maxFPS = 0;          

            while (!_quit)
            {                
                _presentationManager.DispatchEvents();
                _presentationManager.Clear();
               
                //This is the function that render background image. Without this the FPS are about 100
                _presentationManager.ShowLocation(_currentLocation);                

                UpdateMainActor();                

                //Render the player
                _presentationManager.ShowActor(_mainActor);
               
                _presentationManager.ShowFPS(maxFPS);

                _presentationManager.Display();                

                DateTime end = DateTime.Now;

                TimeSpan duration = end - start;
                if(duration.Seconds >=1 )
                {                    
                    start = DateTime.Now;
                    maxFPS = countFps;
                    countFps = 0;                    
                }
                else
                    countFps++;
               
            }
 

3
DotNet / Re: Draw background sprite is very slow
« on: December 20, 2013, 08:41:24 pm »
I know my graphycs card is "pretty" old but I dont understand why with 4 sprite/texture the FPS drops this way.

The creation of the textures is done only the first time I load the background because I store the four texture in a list and from the second time when I display the background I use the spretes/texture stored in the list so I don't recreate them.

Is there a better way than my method that a I could use?

 

4
DotNet / Draw background sprite is very slow
« on: December 20, 2013, 08:22:14 pm »
Hi, I have a game with resolution of 1280x720 but my gfx card cant create a texture directly with that size so I'm   creating 4 textures and draw them.
The problem is that draw that sprites is really slow, about 6/7 FPS.
Could someone tell me if I'm doing something wrong?

Thanks in advance, here's the code:


public void ShowLocation(Location Location)
        {
            if (_sprites.Count == 0)
            {
                Stream stream = new MemoryStream(Location.Background.Bytes);

                for (Int32 y = 0; y < _heigth; y += _heigth / 2)
                {
                    for (Int32 x = 0; x < _width; x += _width / 2)
                    {
                        IntRect view = new IntRect(x, y, _width / 2, _heigth / 2);                        
                        Texture texture = new Texture(stream, view);
                        Sprite sprite = new Sprite(texture);
                        sprite.Position = new Vector2f((float)x, (float)y);                        
                        _textures.Add(texture);
                        _sprites.Add(sprite);                          
                    }
                }

                stream.Dispose();
            }

            foreach (Sprite s in _sprites)
            {
                _window.Draw(s);                
            }
        }

 

Pages: [1]