1
DotNet / Re: Issue with TIME tutorial
« on: November 26, 2012, 04:42:47 am »
I see, thanks a lot man. That makes sense.
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.
Ok so it works. Weird. I was accidentally using the 1.6 release, but I was using the example from the 1.6 docs anyway... so it should've worked.If you have a ATI card that would explain why 1.6 wasn't working. http://en.sfml-dev.org/forums/index.php?topic=3438.0I did have to change while (window.IsOpened()) to while (window.IsOpen()) though. Is that a mistake in the example? It seems like IsOpen() is the correct method.Yes, .IsOpen() is correct. Read above^^ as me and Laurent went back and forth on it.
As for the 64 bit trouble, I will pass to Laurent
Quoteit forces me to use the x86 versionWhy?
using System;
using SFML.Audio;
using SFML.Window;
using SFML.Graphics;
namespace Example
{
class Program
{
static void OnClose(object sender, EventArgs e)
{
// Close the window when OnClose event is received
RenderWindow window = (RenderWindow)sender;
window.Close();
}
static void Main(string[] args)
{
// Create the main window
RenderWindow app = new RenderWindow(new VideoMode(800, 600), "SFML window");
app.Closed += new EventHandler(OnClose);
// Load a sprite to display
Image image = new Image("cute_image.jpg");
Sprite sprite = new Sprite(image);
// Create a graphical string to display
Font arial = new Font("arial.ttf");
String2D text = new String2D("Hello SFML.Net", arial);
// Load a music to play
Music music = new Music("nice_music.ogg");
music.Play();
// Start the game loop
while (app.IsOpened())
{
// Process events
app.DispatchEvents();
// Clear screen
app.Clear();
// Draw the sprite
app.Draw(sprite);
// Draw the string
app.Draw(text);
// Update the window
app.Display();
}
}
}
}
libsfml-graphics.so.2 must be in a path that the library loader (ld) knows. So either you didn't install SFML properly, or you installed it to a path that it doesn't know.
Code: [Select]g++ -c sfmlwindow.cpp
g++ -o sfmlwindow sfmlwindow.o -lsfml-window -lsfml-system
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
int main()
{
sf::VideoMode VMode(800, 600, 32);
sf::RenderWindow Window(VMode, "SFML Window");
while (Window.IsOpened())
{
sf::Event Event;
while (Window.PollEvent(Event))
{
switch (Event.Type)
{
case sf::Event::Closed:
Window.Close();
break;
default:
break;
}
}
Window.Clear(sf::Color(0, 255, 255));
Window.Display();
}
return 0;
}