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 - Jebbs

Pages: 1 ... 21 22 [23] 24
331
D / Re: Destroy destructor crashes?
« on: December 17, 2012, 11:17:15 pm »
Others use structs or scoped objects (part of the language in D1, a Phobos template in D2) when possible to cleanup when an object goes out of scope. Personally, I just pretend the destructors don't even exist.

A scoped object wouldn't be a part of the GC, would it? This sounds more like a RAII technique to me. And like Nekroze was wondering, they would be allocated on the stack instead of the heap, correct? That said, if we were to use the sfXXX objects directly, they would be allocated on the stack anyways so using a struct or scoped object doesn't sound like the worst thing to do even if they are long-lived.

332
D / Re: Destroy destructor crashes?
« on: December 17, 2012, 09:56:17 am »
I just wanted to post in here letting people know that my answer is incorrect.

In this case, the error
Quote
First-chance exception: core.exception.InvalidMemoryOperationError

Is caused by the Derelict library unloading the .dll's before the objects are deleted. Since the Derelict maps the functions to function pointers, when Derelict unloads first the function sfImage_destroy no longer exists and we get the error.

As soon as I am 100% sure of what we should be doing when wrapping sfObjects in a D class, I will post it here for others to know!

333
D / Re: Destroy destructor crashes?
« on: December 16, 2012, 10:37:53 pm »
Hmm... I wonder how many people are working on wrappers, haha.

In any cast, this is a garbage collection issue. You don't actually have to call sfXXX_destroy on anything. The error is given because you deleted the pointer manually, and garbage collection is trying to delete it directly after. I think you get a similar runtime error in C++ when you try to delete a null/empty pointer.

334
D / Re: problem when compiling derelict3 sfml2 wrong dll
« on: December 15, 2012, 08:24:52 am »
@Jbolte

Since you are already making updates to the Derelict library, I'd like to point out that it is still missing the functions sfMouse_getPositionRenderWindow and sfMouse_setPositionRenderWindow from the graphics package!

Figured it would be easier for you to do than for me :P

335
General / Re: Collision detection sfml 2.0
« on: December 13, 2012, 04:14:05 am »
The sf::Rect class has the methods Rect.contains and Rect.intersects, so for basic collision detection I would say that's a good place to start.

336
D / Re: problem when compiling derelict3 sfml2 wrong dll
« on: December 13, 2012, 04:09:18 am »
That's awesome!

What compiler did you use?

I'm still having some strange issues getting CMake to work. It can't seem to find my compiler or something. Any advice for how you did it?

Edit:
Just kidding. After doing some good research and dedicating some time to it, I got it to work!

337
C / Re: Finding the size of things!
« on: December 08, 2012, 01:33:37 pm »
Ah, well I was totally mistaken on that then. I didn't even make the connection that it was a file in memory, not an object in memory. That said, I can't call sfTexture_copy with a const sfTexture pointeras I get compiler crankiness.

Specifically:
 Error: function pointer sfTexture_copy (sfTexture* texture) is not callable using argument types (const(sfTexture)*)

(DMD compiler for the D language)

338
C / Re: Finding the size of things!
« on: December 08, 2012, 11:17:42 am »
Here is an example of what I mean.

sfTexture* someTexture = sfTexture_createFromFile("some image.png", null);


How can I figure out the size of someTexture? I'm not doing the allocating myself.


I'm working on some binding stuff at the moment. My current issue relates to some stuff I'm doing with the Font class. My Font will return a Texture representation with the function getTexture just like sf::Font, but sfFont_getTexture returns a const pointer to a sfTexture. I didn't want to cast away the const, so I thought I would make a new sfTexture using sfTexture_createFromMemory, and then I came to where I am now.

In any case, I have experienced this elsewhere when playing with my binding and I now feel like it is something I should make sure i can handle.

Any suggestions?

339
C / Finding the size of things!
« on: December 08, 2012, 10:31:54 am »
Hey guys,

In the various createFromMemory functions, one of the parameters is the size of the object in bytes. How would one go about finding the size of the object so that they could enter in the correct size to use these functions?

Thanks!

340
General / Re: Window Focus and Input
« on: December 03, 2012, 09:18:45 am »
You shouldn't be calling pollEvent from different places in code. That's why you're having those issues. Once an event is handled, it no longer exists in the event queue. Instead, maybe you could pass text based events to your input class as they are handled in your main loop?

341
Window / Re: Icon display at window's creation?
« on: October 17, 2012, 07:49:41 am »
Thanks for the reply!

That is pretty awesome that it is in the works! Interestingly enough, I was going to try a similar approach with some experiments in order to come up with a work around though I hadn't had much luck thus far.

Keep up the awesome work!

342
Window / Re: Icon display at window's creation?
« on: October 17, 2012, 04:20:03 am »
That's unfortunate, but I guess if it can't be helped it can't be helped.

I feel like it should be possible to have the window appear with an icon already set though. Maybe I can put it in as a feature request?

343
Window / Icon display at window's creation?
« on: October 16, 2012, 11:34:28 am »
I don't know about other systems, but this happens for me on Windows. Every time I set the window's icon, there is always a delay between when the window is created and when the icon I set to the window actually get's displayed as the application's icon in the taskbar. This isn't a huge deal, but it does bug me a little bit.

Is there anything I can do to have the icon loaded and displaying at the same time the window is created and pops up? Or perhaps this is a problem specific to my computer, as I tried to do a search for this and didn't find anything on the subject.

Thanks very much guys!

344
D / Re: OO Wrapper
« on: October 14, 2012, 09:29:30 pm »
Oh, it's cool man. It's just a name.  ;D 

I have all of the system and window modules done except for a couple of things. I'm not going for just a wrapper though. I'm pretty much porting the API into D. Currently I'm working on getting some of the inheritance stuff working for the graphics module(drawable for instance) , but I'm also going to play around with the audio module soon too.

I'm doing everything by hand though. It's a project for better learning some of the semantics of the D language. I'm sure that as I learn more I might go back and rewrite some things(like my own bindings. currently I'm using derelict as a back end), but so far it all works pretty well. It definitely makes me happy how nice of an API SFML is, and I like how well it is documented.


345
D / Re: OO Wrapper
« on: October 14, 2012, 07:25:54 am »
That's pretty funny that you named it SFML-D. I was was planning on using the same name! And I was also just about to put it on github.

Stealin' my thunder  :P

Pages: 1 ... 21 22 [23] 24
anything