View previous topic :: View next topic |
Author |
Message |
moechofe
Joined: 07 Oct 2006 Posts: 25 Location: Paris, France
|
Posted: Wed Mar 24, 2010 1:55 pm Post subject: How to start with sfml ? |
|
|
Hi,
I'm trying to open a window with sfml and Derelict2 Code: | module sfmltest;
pragma(lib, "DerelictSFML.lib");
pragma(lib, "DerelictUtil.lib");
import derelict.sfml.sfml;
void main()
{
DerelictSFMLSystem.load();
DerelictSFMLWindow.load();
sfWindowSettings Settings = {24, 8, 0};
sfVideoMode Mode = {800, 600, 32};
char* titre = "titre";
sfRenderWindow* window = sfRenderWindow_Create(
Mode,
titre,
sfResize|sfClose,
Settings );
sfRenderWindow_Destroy(window);
} |
Result: Code: | object.Exception: Access Violation - Read at address 0x0 |
Do I forgot something ?
sorry for my english
Last edited by moechofe on Tue Mar 30, 2010 11:42 am; edited 2 times in total |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed Mar 24, 2010 7:44 pm Post subject: |
|
|
Ok, something's wrong. I'm getting an Access Violation on Windows with D1. I've narrowed it down to the call to sfRenderWindow_Create, but I haven't yet figured out the cause. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed Mar 24, 2010 7:51 pm Post subject: |
|
|
OK, I see what the problem is now. sfRenderWindow_Create is part of SFML Graphics, but you aren't loading it. You need to call DerelictSFML_Graphics.load() instead of DerelictSFML_Window.load(). _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
moechofe
Joined: 07 Oct 2006 Posts: 25 Location: Paris, France
|
Posted: Thu Mar 25, 2010 1:24 am Post subject: |
|
|
Yes, It works for me now.
I don't figure out that SFMLwindow is for sfWindow_Create and SFMLgraphic for sfRenderWindow_Create
Tanks you. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|