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

Author Topic: Cannot get any drawing  (Read 3301 times)

0 Members and 1 Guest are viewing this topic.

Aravol

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Cannot get any drawing
« on: June 25, 2014, 04:58:39 am »
Trying to string up a basic draw loop, and I suddenly find myself unable to get any draw functions to work properly.

Any attempts to call RenderStates.Default results in a System.AccessViolationException.
Any attempt to call draw with new RenderStates does not crash, but does not display anything to the window.

I've tried with shapes, sprites, and have attempted doing this both synchronously and asynchronously.
I've manually switched out my CSFML libraries to make sure the proper version is being bound.
I've tried this with both x64 and x86.
I've made sure the Texture is loaded (size information is visible in debugger on the Sprite)
I've tried switching between .NET 4.0 and 4.5

All in Visual Studio 2012 on a windows 7.

Any help would be gretly appreciated

The following code is enough to reproduce the issue

                // Initialize values
                Window = new RenderWindow(
                    new VideoMode(800u, 600u), "Hello World");

                Window.Closed += (sender, e) => Window.Close();

                var test = new Sprite(new Texture(@"Content\PlayerTexture.png"));

                while (Window.IsOpen)
                {
                    Window.DispatchEvents();
                    Window.Clear();
                    test.Draw(Window, RenderStates.Default);
                    Window.Display();
                }

Aravol

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Cannot get any drawing
« Reply #1 on: June 25, 2014, 06:44:52 am »
So, as an update, I've managed to fix the problem by reverting my submodule for the .NET wrappers to the 2.1 Tag. Seems there may be a problem with the head revision

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Cannot get any drawing
« Reply #2 on: June 27, 2014, 03:49:08 am »
If you use the latest master branch of SFML.NET you must also recompile the latest master of SFML and CSFML. There has been changes to blending modes and this is most likely the source of your problem.
« Last Edit: June 27, 2014, 03:54:13 am by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor