SFML community forums
Bindings - other languages => DotNet => Topic started by: NinjaFighter on April 09, 2011, 07:06:06 am
-
I test a simple project on a netbook with Intel gma 3150 graphics card, and it doesn't work. The screen flickers with strange artifacts (looks like can't create the surface or something like that...). I test the same project in various other machines and it works very well. I don't know what can be...
-
Crappy drivers, most likely.
-
Let me add that I'm using Intel GMA X3100 and everything works fine. Thus most probably a driver issue, as Laurent said.
-
Well nobody wrote it but just said "Driver issues"....
Do you have the latest drivers for your card? If so then it's "Crappy Intel Drivers". Intel don't like OpenGL for some reason :S
-
I try now with the latest drivers from intel website and doesn't work :S... I don't know what can be. :S
-
Eureka! I found it! The problem occurs only when I use a RenderImage!
Here's my test code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFML.Graphics;
using SFML.Window;
namespace TestSFML
{
class Program
{
static KeyCode lastKey = KeyCode.N;
static void Main(string[] args) {
VideoMode vm = new VideoMode(320, 240);
RenderWindow app = new RenderWindow(vm, "SebaTest SFML");
app.Closed += new EventHandler(app_Closed);
app.KeyPressed += new EventHandler<KeyEventArgs>(app_KeyPressed);
View view1 = new View(new FloatRect(0, 0, 160, 120));
View view2 = new View(new FloatRect(0, 0, 80, 60));
Image testImg = new Image("sprite.png");
testImg.Smooth = false;
Sprite spr = new Sprite(testImg);
Font font = new Font("ProFontWindows.ttf");
Text text = new Text("texto de prueba", font);
RenderImage surface = new RenderImage(320, 240);
surface.Draw(spr);
//surface.DefaultView.Size = new Vector2(-320,240);
//surface.SetView(surface.DefaultView);
//spr.Scale = new Vector2(-1, 1);
//spr.FlipX(true);
//surface.Draw(spr);
surface.Display();
Sprite surfaceSprite = new Sprite(surface.Image);
while(app.IsOpened()) {
app.DispatchEvents();
vm.Height = 180;
vm.Width = 320;
app.Clear(Color.Blue);
spr.Rotation = 0f;
spr.Position = new Vector2();
//app.Draw(spr);
spr.Rotation = 2.57f;
spr.Position = new Vector2(0, 10);
//app.Draw(spr);
app.Draw(surfaceSprite);
text.DisplayedString = "Ășltima tecla: " + lastKey.ToString() + "\n"
+ (int)lastKey;
app.Draw(text);
app.Display();
}
Console.WriteLine("end!");
Console.ReadKey();
}
static void app_KeyPressed(object sender, KeyEventArgs e) {
lastKey = e.Code;
}
static void app_Closed(object sender, EventArgs e) {
RenderWindow rw = (RenderWindow)sender;
rw.Close();
}
}
}
If I comment the surface creation, this works well on the netbook... otherwise, only works in the other machines.
-
Which revision of SFML 2 are you using?
-
the folder name is "LaurentGomila-SFML-d53750f" this is related with the current revision?
-
Ok, you should try the latest revision, I've made some important modifications to RenderImage.
-
I try to download and compiling the lastest SFML2 version, but I don't know what happen. I have this error when I try to compiling the dotNet version.
Compiling Visual C++ 2008 libraries...
Compiling release libraries...
Microsoft (R) Build Engine Version 3.5.30729.5420
[Microsoft .NET Framework, Version 2.0.50727.5420]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
C:\Users\HP\Downloads\SFML\LaurentGomila-SFML-4892866\bindings\dotnet\build\vc2
008\SFML.net.sln.cache(232,5): error MSB4126: The specified solution configurat
ion "Release|MCD" is invalid. Please specify a valid solution configuration usi
ng the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:
Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to u
se the default solution configuration.
Done
Done
Press any key to continue . . .
I want to test this version in the netbook... but cannot compile it, and I don't know what can be. :(
-
How do you compile it?
-
Simply I do double click at:
bindings\dotnet\build\build-all-windows.bat
Sorry I'm far to be an expert with these things :(
-
Maybe... can be because I've installed only Visual CSharp 2010, and Visual C++ 2008, but not the Visual CSharp 2008?
This is strange, maybe could be because of this, I'll try to compile it with Visual C# 2008 instaled, and see what happen then.
-
Maybe... can be because I've installed only Visual CSharp 2010, and Visual C++ 2008, but not the Visual CSharp 2008?
Nop.
Try to compile with the SFML.Net solution, honestly I haven't used the batch build for a long time and I'm not sure it still works.
-
Good news! :)
I compile the latest version now, and works perfect in the netbook :)
I'm very happy now :)