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.


Messages - RobotGymnast

Pages: 1 [2] 3 4
16
General / Repository down?
« on: March 06, 2011, 07:21:21 pm »
I'm trying to pull the latest code from the repository, and this is what keeps happening:

Code: [Select]
me@lappy486:~/devl/sfml$ svn checkout http://sfml.svn.sourceforge.net/viewvc/sfml
svn: Repository moved temporarily to '/viewvc/sfml/'; please relocate

17
D / .dispose()
« on: February 07, 2011, 11:59:54 pm »
So it turns out that it's completely necessary to dispose everything, like Images, otherwise memory leaks result, and exceptions are soon thrown, as demonstrated in this simple piece of code:

Code: [Select]

import dsfml.graphics.all;

void main()
{
while(true)
auto rect = new Image(1024, 1024);
}



We can use .dispose() inside the loop, to free the allocated memory;
the only problem is, this throws exceptions and/or gives access violations when the objects are ACTUALLY destroyed, as demonstrated in:

Code: [Select]

import dsfml.graphics.all;

void main()
{
      auto rect = new Image(1024, 1024);
      rect.dispose();
}


What's the proper procedure here? Either memory leaks or access violations?

Edit: Fixed by calling GC.collect() manually once-in-a-while.

18
D / Typo in KeyCode
« on: February 06, 2011, 02:39:58 am »
The Right Shift key in KeyCode is called RShist, instead of RShift.

19
D / dsfml.*.all
« on: February 05, 2011, 09:44:30 pm »
Are these modules supposed to publicly import everything else in the package? I ask because NONE of them actually import everything else, which leads to some confusing-looking imports, like

Code: [Select]

import dsfml.graphics.all, dsfml.graphics.renderimage;

20
D / RenderImage is abstract class?
« on: February 05, 2011, 09:42:33 pm »
Is dsfml.graphics.renderimage.RenderImage supposed to be an abstract class? It overrides .dispose(), but it overrides it with a package-private .dispose(), which (I believe) makes it nonvirtual. As a result, it's abstract - is it supposed to be?

21
Graphics / Resizing images?
« on: February 05, 2011, 09:30:45 pm »
SFML2's perfect, thanks!

22
Graphics / Resizing images?
« on: February 05, 2011, 08:29:51 pm »
Is it possible to resize an image, and store it as an Image, rather than a Sprite?

23
Graphics / Re: Splicing together images?
« on: February 04, 2011, 12:47:00 pm »
Quote from: "JAssange"
Quote from: "RobotGymnast"
Is there a way to tile an image or splice together multiple images? I have a simple .PNG of a stone wall which can be tiled, but I can't figure out how to tile it to a certain size.

Set the Subrect and draw repeatedly.


Is there a way to only do this once? Say, to save the tiled image as an Image?

24
Graphics / Splicing together images?
« on: February 04, 2011, 03:51:19 am »
Is there a way to tile an image or splice together multiple images? I have a simple .PNG of a stone wall which can be tiled, but I can't figure out how to tile it to a certain size.

25
D / Exception-throwing in destruction
« on: February 03, 2011, 09:44:12 pm »
Quote from: "Laurent"
Nothing, this has to be handled in the binding directly (if the problem is similar).


So, for now, my solution has to be to put all wrappers inside scoped-destruction objects (i.e. structs)?

26
D / .dispose()
« on: February 03, 2011, 01:01:47 pm »
Does one need to bother disposing everything using .dispose(), or is it just if I want to invalidate it prematurely?

27
D / Exception-throwing in destruction
« on: February 03, 2011, 12:50:56 pm »
Quote from: "Laurent"
Looks like the same problem that I had for the .Net binding. Apparently the GC is running in a thread that is not the main thread, which still runs after the latter has ended.
To solve this, the binding has to instanciate a dummy sf::Context in the GC thread.


I tried putting
Code: [Select]

auto context = new Context;


At the beginning of my thread, and it didn't like that one bit. What should I do?

28
D / Exception-throwing in destruction
« on: February 03, 2011, 03:08:50 am »
Code: [Select]

module main;

import dsfml.graphics.all;
import dsfml.window.all;
import std.stdio;

class ImageWrapper
{
private Image image;

this()
{
image = new Image(200, 200, Color.WHITE);
}

~this()
{
image.dispose();
}
}

void main()
{
try
{
try
auto img = new ImageWrapper;
catch(Exception e)
writeln(e.msg);
}
catch(Error e)
writeln(e.msg);
}


I'm guessing this throws an exception because the libraries are unloaded at the end of main(), and destruction occurs by the garbage collector after. If that's the case, then does that mean any wrappers I create need to be structs? Or am I misdiagnosing?

29
D / DSFML2 Problems
« on: February 02, 2011, 09:30:53 pm »
Quote from: "Trass3r"
Btw, unless you use some other compiler you need to compile 32-bit dlls.
dmd is only able to produce 32bit code on Windows so far.


Oh geez you're right. I really should have thought of that. I'll go fix that and see if that changes anything.

Update: Combining 32-bit and unchecking BUILD_SHARED_LIBS sure helped. Compiling fine now. Thanks for all your patience!

30
D / DSFML2 Problems
« on: February 02, 2011, 08:45:15 pm »
Quote from: "Laurent"
What's your CMake build configuration (compiler and options)?


Code: [Select]

Compiler: cl
C++ flags: /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHesc /GR
C++ debug flags: /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
C++ libs: kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
C flags:  /DWIN32 /D_WINDOWS /W3 /Zm1000
C debug flags: /D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1
Linker flags:  /STACK:10000000 /machine:x64
Linker debug flags: /debug


Quote from: "Laurent"

You should build static SFML libs, not dynamic ones. This way you have 1 DLL per module, not 2.


Again, I set the projects to build static libraries, but .DLLs were still produced.

Pages: 1 [2] 3 4