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

Pages: [1]
1
DotNet / SFML.Net 2.0 RenderTexture bug - flickering
« on: July 01, 2013, 12:09:47 am »
@EDIT I updated my graphics driver and problem now doesn't occurs!
Probably this problem is caused by my graphics card (GF 7300 GT)
It's very strange because when i minimize and restore app this problem doesn't occurs!


Hello.
Sorry for my bad English.

I am clearing and drawing some vertices on RenderTexture every frame and i am drawing RenderTexture result on RenderWindow.
The image "flashes" every 10 frame.

When i am drawing directly to RenderWindow this problem doesn't occurs.

I downloaded SFML.Net 2.0 directy from the site of course.

The following video shows a bug:


Source code which i am used to make video:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SFML;
using SFML.Window;
using SFML.Graphics;

namespace sfmltest
{
    class Program
    {
        static void Main(string[] args)
        {
            RenderWindow window = new RenderWindow(new VideoMode(800, 600), "sfml test");
            window.Closed += (s, e) => { window.Close(); };

            RenderTexture renderTexture = new RenderTexture(800, 600);

            Sprite sprite = new Sprite(renderTexture.Texture);

            Vertex[] circle = BuildCircle();

            while (window.IsOpen())
            {
                window.DispatchEvents();

                window.Clear();

                renderTexture.Clear(new Color(0, 0, 0, 0));
                renderTexture.Draw(circle, PrimitiveType.TrianglesFan);
                renderTexture.Display();

                window.Draw(sprite);

                window.Display();
            }
        }

        static Vertex[] BuildCircle()
        {
            Vertex[] circleVertices = new Vertex[36 + 2];

            circleVertices[0] = new Vertex(new Vector2f(400, 300), Color.Green);

            float currentDir = 0f;
            float dirStep = 360f / (circleVertices.Length - 2);
            for (int i = 1; i < circleVertices.Length - 1; i++)
            {
                Vector2f pos = new Vector2f();
                pos.X = (float)Math.Cos(Math.PI / 180 * currentDir) * 250f;
                pos.Y = (float)-Math.Sin(Math.PI / 180 * currentDir) * 250f;
                pos += new Vector2f(400, 300);

                circleVertices[i].Position = pos;
                circleVertices[i].Color = new Color(192, 255, 64, 64);

                currentDir += dirStep;
            }

            circleVertices[circleVertices.Length - 1] = circleVertices[1];

            return circleVertices;
        }
    }
}
 

2
Window / Get pressed key via Keyboard class.
« on: March 30, 2013, 08:18:53 pm »
Is it possible to get pressed key on keyboard via Keyboard class? Something similar to OnKeyboardKeyPressed event.
Example (C#):
Keyboard.Key key = Keyboard.GetLastKey();

3
Feature requests / Modern UI support by GL2DX
« on: February 08, 2013, 04:31:38 pm »
Hello!
I found OpenGL to DirectX wrapper - https://gl2dx.codeplex.com/ which can be used in Windows 8 Modern UI apps.
Would be possible to run SFML on this wrapper?

4
DotNet / [2.0 RC] View bug
« on: January 27, 2013, 06:10:17 pm »
Hello! Sorry for my bad english.

I have problem with View class. When i apply new position, rotation etc. to view it works, but nothing changes on screen. It was only change when i use SetView method.
Exapmle:

window.GetView().Move(new Vector2f(5,5));//nothing changes on the screen

window.SetView(window.GetView().Move(new Vector2f(5,5)));//only now view was applied to the screen

It is bug or not?

Thanks for replies.
Utermiko

Pages: [1]
anything