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

Pages: 1 2 [3] 4 5 ... 22
31
Java / Re: TMX loader for JSFML
« on: June 10, 2014, 06:20:47 am »
No, there is no such thing yet. JSFML is pretty raw still, I don't know of any extensions for it.
So, go ahead and write one. :D

32
Java / Re: Draw sprite into a thread
« on: June 10, 2014, 06:18:53 am »
Well, the error message concerns the failure of creating a texture, which happens way before you create the sprite. You seem to create a texture of 0x0 size, and that won't work.

If you can't figure out what's wrong, please post the code that you use for loading your texture?

33
Java / Re: Incorporating OpenGL with JSFML
« on: May 12, 2014, 10:05:05 am »
Overkill posted a working example for LWJGL: http://en.sfml-dev.org/forums/index.php?topic=13740.0
There were (unresolved?) problems with the depth buffer it seems, but that shouldn't matter for 2D environments.

I also think that Groogy managed to get JSFML to work with JOGL, but I cannot find those posts back for some reason. Maybe he can post a short example somewhere for future reference. ;)

34
Java / Re: New Version
« on: May 06, 2014, 09:20:48 am »
Hey, any specific reasons?
I realize that the "getPlayingOffset()" fix is not yet released and it should be done soon, but other than that, there is nothing new.

I won't work on support for SFML 2.2 until that is released.

35
Java / Re: Java equivalent of the following
« on: March 25, 2014, 09:34:39 am »
Am I right when I assume that you are having a problem with Java, not directly JSFML? I am asking because I am a little confused over what the problem is. I believe you are struggling about which Java collection class to use. There are plenty of them, each is optimized for certain use cases. I suggest reading Oracle's documentations or some tutorial on Java collections.

In your case, if you need a dynamic array and you want to access elements by their indices, use the ArrayList. It uses an array internally and is therefore optimized for direct index access. The Vector class does practically the same, but it's a thread-safe version. Unless you need thread-safety, there's no need for you to use the Vector class.

Concerning the decision between ArrayList and Vector, here's a nice little face-off:
http://www.javaworld.com/article/2077425/java-se/vector-or-arraylist-which-is-better.html

36
Java / Re: JInternalFrame and a RenderWindow?
« on: March 05, 2014, 11:23:04 am »
That will be WAY too performance-heavy and slow. Forget it.
As said, there is a branch that does exactly what you want, but I have no built version of it released. You'll have to be patient a little.  :-\

37
Java / Re: JInternalFrame and a RenderWindow?
« on: March 03, 2014, 02:05:43 pm »
Hey,
integration of JSFML RenderWindows into Swing GUIs exists (it's called "RenderCanvas"), but it's unreleased so far. It works fine for Windows as far as I can tell and I think it does on Linux, however, there is no Mac code at all yet, since I don't have one.

So at the time being, there is no way for you to do this.

Looking at things now, I might as well merge that "render-canvas" branch into the master branch, so it'd be available for Windows and Linux at least. I hope I can find some time for this in March.

38
Java / Re: Font won't render if it is loaded in a different class
« on: February 26, 2014, 06:22:53 pm »
Your font is never loaded due to your code. Your static initializer states:
public static Font arial = new Font();

arial is therefore not null. However, you only load the font if arial is null:
if(arial == null){ /* loading code */ }

Alas, the loading code is never executed. I believe what you want to do is to initialize the arial variable with null:
public static Font arial = null;

Don't forget to construct it before you load it, then.

39
Java / Re: Problem with playing sound
« on: February 26, 2014, 02:28:58 pm »
I'm honestly not sure. I know that the free tool Audacity can open as good as any WAV format. What I would do now is open that sound file in Audacity and save it as 16-bit PCM (pretty widespread standard that SFML can handle, too).

Would be nice to know if that works. Sorry I don't know an easier method right now. :(

40
Feature requests / Re: set functions should return reference to self
« on: February 24, 2014, 01:24:06 pm »
Agreed, function chaining is pretty popular in Java, and the result in an inconveivable mess.
Granted it's a matter of taste, it still doesn't make any sense for something that is simply supposed to set a member value to return anything.

41
Java / Re: Problem with playing sound
« on: February 24, 2014, 07:23:14 am »
Quote
Sound duration: 0.0 seconds
Well, there you have the reason as to why you don't hear anything.

Now, I'm pretty sure that your sound is not actually 0 seconds long, so something is probably wrong with the file. I think have made the experience myself that SFML (or to be more exact: libsndfile) does not support all WAV formats, however, I cannot find a reference right now.

Do you know exactly what format your WAV file is in? If not, could you upload it?

EDIT:
Little update, the libsndfile website lists the supported formats. Not sure how I didn't find it earlier:
http://www.mega-nerd.com/libsndfile/

42
Java / Re: Problem with playing sound
« on: February 22, 2014, 08:46:52 am »
Well, did the sound load successfully, or do you get that "Error! sound failed to load properly" message in the console that you defined? You did not mention that. :)

43
Java / Re: Problem with JSFML
« on: February 21, 2014, 09:28:27 am »
It's very simple: your friend has an older Java version.

JSFML requires Java 7. He most likely uses Java 6, but that has reached its end of life last year and is no longer updated by Oracle. He should update to Java 7.

44
Java / Re: 15%-20% CPU usage when drawing a grid
« on: February 12, 2014, 04:33:29 pm »
I'm not really sure why the rectangle approach would use that much CPU load, I will try this myself one of these days.

Anyway, this is a job for vertex arrays indeed. In that latest version of your code, if you call your "update()" function only when needed, it should approach 0% CPU load. There's no need to fill the vertex array with the same information in every frame, it's enough to do it when the application starts or something in the game field changes.

As for your VSync observation, yes, one is not supposed to use BOTH VSync and frame limiting, as they will get in the way of each other. This is also mentioned in the Javadoc.

45
Java / Re: I'm missing something obvious
« on: February 03, 2014, 11:08:08 pm »
Imports need to be declared before the first class in a Java source file... please read about how to write a basic Java program.

Pages: 1 2 [3] 4 5 ... 22