Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (683)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (750)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 306
1  Game Development / Newbie & Debugging Questions / Re: LWJGL 3 glfwSetWindowIcon does not work - at all on: 2016-07-20 18:41:30
If someone with the necessary power reads this: You can close this ticket if you want to, as it solved  Wink
This is not how this forum works Smiley What if somebody wanted to add some other piece of wisdom? (Or share a good joke about... ehm... buffers!)

You can put [solved] in the subject-line though, the forum will turn it into a pretty little picture.

2  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-20 05:21:22
If this code is useful to anyone, I can post it, but I want to handle the license and permissions stuff correctly.

Basic usage:
1  
    float[] audioFloats = OggVorbisToPCMFloats(URL oggUrl);

How do I know how many channels the audio stream is comprised of?

Maybe you could return float[][] or an actual POJO with some meta-data like sample-rate.

Transforming all samples into floats, only to have them converted into bytes/shorts again to play it seems a bit cumbersome. It may also be disadvantageous to be forced to decompress the entire file before you can play it. For long audio files this means significant decoding time and serious memory usage (especially due to the floats).
3  Discussions / General Discussions / Re: JGO bounced back on: 2016-07-13 09:34:48
A surge in visitors (bots?) blew up apache's access.log to 20GB, taking down MySQL and crashed a few MyISAM tables beyond recovery.

Obviously the log-files should have been in rotation-mode, but it wasn't.
4  Discussions / General Discussions / JGO bounced back on: 2016-07-13 01:33:50
I found some time (3:30AM) to restore JGO from a backup just prior to the crash.

Happy posting.
5  Game Development / Newbie & Debugging Questions / Re: Temporary ObjectOutputStream wrapping InputStream on: 2016-07-06 23:04:00
1  
2  
3  
4  
5  
   public static GLSLFile deserializeFrom(InputStream input) throws IOException {
      ObjectInputStream ois = new ObjectInputStream(input);
      return (GLSLFile) ois.readObject();
      //I feel so dirty for not closing ois...
   }

Is this correct? Can this explode somehow? What am I supposed to do here?!
Yes it can explode, because ObjectInputStream is buffered, and may read beyond the boundaries of the object.
The code I provided in the previous reply doesn't explode as much, they say.
6  Game Development / Newbie & Debugging Questions / Re: Temporary ObjectOutputStream wrapping InputStream on: 2016-07-06 22:56:00
Just use what mother nature provided:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
   public void serializeTo(OutputStream output) throws IOException {
+     ByteArrayOutputStream baos = new ByteArrayOutputStream();
      try(ObjectOutputStream oos = new ObjectOutputStream(baos)) {
         oos.writeObject(this);
      }
+     new DataOutputStream(output).writeInt(baos.size());
+     baos.writeTo(output); // pump buffered data into the output
   }

   public static GLSLFile deserializeFrom(InputStream input) throws IOException {
+     DataInputStream dis = new DataInputStream(input);
+     byte[] buf = new byte[someSanityCheck(dis.readInt())];
+     dis.readFully(buf);

+     try(ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(buf))) {
         return (GLSLFile) ois.readObject();
      }
   }
7  Discussions / General Discussions / Re: Interesting proposals: Java 9 and beyond on: 2016-07-06 21:21:28
Keep in mind Java EE != Java JDK.

Obviously, Oracle will handle the fallout of all confusion in the worst possible way, and in 3 months time the story will be nuanced somewhat.
8  Discussions / General Discussions / Re: Virtual Reality on: 2016-07-06 13:28:13
Just tried the Microsoft HoloLens. AMA.
What was it like.
9  Game Development / Game Mechanics / Re: Using Bullet for something other than simulations on: 2016-07-02 12:36:11
Bullet has a collision callback, but the collision callback is called for as long as the object is in contact with another object, instead of being called when the object FIRST collides with another object. This means that if I use the collision callback to play impact sounds, the sounds will be played repeatedly for as long as the object is in contact with the other object.

Of course, there are workarounds, but it'd be incredibly messy and I want to avoid that.

I don't understand the problem... this is what programming is all about: taking something low-level and transforming it into something high-level. Why would this workaround feature be messy by definition? That's for you to design.
10  Java Game APIs & Engines / Java 2D / Re: Fast sprite rotation on: 2016-06-27 17:57:37
@KaiHH: text book case of premature optimisation Pointing

It makes the code less simple (simplicity is important) and won't have significant impact on performance.
11  Java Game APIs & Engines / OpenGL Development / Re: Discussion: The mother of all shading languages on: 2016-06-21 19:22:20
Be pragmatic, because life is short 'n all. Just go with the pre-compiler Pointing
12  Game Development / Newbie & Debugging Questions / Re: [Libgdx]GWT 'not emitting code for accessing method' on: 2016-06-18 18:37:15
CopyOnWriteArrayList has perfectly fine usecases in single-threaded code.
13  Games Center / WIP games, tools & toy projects / Re: TritonForge || 2D RPG Sandbox (DOWNLOAD V2 NOW-AutoUpdater!) on: 2016-06-06 05:14:19
Unlocked upon request Pointing
14  Game Development / Newbie & Debugging Questions / Re: [solved][libGDX] Tile bounds = Entity bounds -> Cannot move in between on: 2016-06-02 18:26:48
If you use a circle or a rounded-rectangle as collision shape for your player, you'd squeeze right through any narrow entrance.
15  Discussions / General Discussions / Re: Virtual Reality on: 2016-06-01 16:26:01
... 28nm to (kinda not really but almost) 14nm ...

They seriously made transistors 4x as small (as opposed to 2x) from one generation to another? I'm a bit surprised. Pointing
16  Discussions / General Discussions / Re: Next Job in IT Section ? on: 2016-05-30 20:01:16
Finish your education Pointing (But yes, you can get an IT job at 17, given you have skill X and Y, and have experience with Z.)
17  Games Center / WIP games, tools & toy projects / Re: TreeML markup language on: 2016-05-30 16:03:52
Yes, parsers using callbacks are a nice way to separate parsing logic from your data-model, even if you only have 1 interface implementation.
18  Game Development / Shared Code / Re: Bits, Bytes and Insanity on: 2016-05-27 15:09:22
A bit input / output stream is surprisingly useful when you're dealing with native code (eg. reading codecs and such).
Or realtime networking code, where you try to fit everything+dog in ~1490 bytes.
19  Games Center / WIP games, tools & toy projects / Re: TreeML markup language on: 2016-05-27 14:43:58
That document is as relevant as the reason it gives for the line-width of 80 characters Pointing



Why are we hijacking this innocent little thread?
20  Games Center / WIP games, tools & toy projects / Re: TreeML markup language on: 2016-05-26 19:54:28
BTW: Here is a working JavaCC grammar for your language, which accepts your example file: https://gist.github.com/httpdigest/ce6479b041dec9efe3b42b54f6836461
Negative floats! Pointing
21  Discussions / General Discussions / Re: RSS feeds for JGO still broken since October 2015 on: 2016-05-25 08:31:03
I have no time to investigate this. The main problem is that during PHP-script execution, the PHP executable is terminated. Hard to debug without spending quite a bit of time on it.
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-05-21 17:35:54
Err, it would take 3 days.
23  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-05-17 04:47:03
Got this in the mail today and just finished solving it! It took a good hour or two, was a lot of fun. As with the 7x7 and gigaminx, I'm sure my solve time will be halved the next time. Something about the first solve seems to take a very long time even when it's just a larger version of another puzzle.


How many of such cubes would you solve for me if I paid you $0.02 an hour?
24  Game Development / Newbie & Debugging Questions / Re: [SOLVED] QuadTree fails after updating each frame on: 2016-05-15 01:43:12
1  
boolean topQuadrant = r.getY() < horizontalMidpoint && r.getY() + r.getHeight() < horizontalMidpoint;

This will never yield true, unless r.getHeight() returns a negative number ofcourse.
25  Game Development / Game Mechanics / Re: Blending Colours on: 2016-05-15 01:33:14
1  
2  
3  
4  
5  
6  
7  
8  
t = 0.25f;
blended.r = lerp(t, a.r, b.r);
blended.g = lerp(t, a.g, b.g);
blended.b = lerp(t, a.b, b.b);

public static float lerp(float t, float a, float b) {
   return a + t * (b - a);
}
26  Java Game APIs & Engines / Java 2D / Re: BufferStrategy on: 2016-05-13 05:22:55
I have this code with me (it's even working in 2016, but originally I wrote it in 2012). http://pastebin.com/TABWDFUE

Ask me if you have any questions regarding it.

You have 3 bugs in that code:
 1. You check for a displaymode with 32 bit color depth, as opposed to the color depth of the current displaymode. Just use device.getDisplayMode() as a reference, or use it directly. No need to mess with Toolkit.
2. You 'center' the mouse by dividing width and height by... four.
3. You set the displaymode N times in rapid succession when there are N displaymodes with the same width, height and bit-depth, but different refreshrates. N is likely to be >= 4
27  Java Game APIs & Engines / Java 2D / Re: BufferStrategy on: 2016-05-12 20:53:09
Never ever do this:
1  
device.setDisplayMode(new DisplayMode(d.width, d.height, depth, refresh));


Java AWT just cannot cope with your own DisplayMode instances. Pick one from the DisplayMode[] reported by your device. Even a completely identical manually created instance will not function well. This has been the case for over a decade, learn from my mistakes. Pointing

It might not even be related to the issue you are facing, just fix it anyway Smiley
28  Game Development / Game Mechanics / Re: OBJ conventions on: 2016-05-12 19:28:22
This is a highly unlikely pattern.

Use {0,1,2}, {2,3,0} as mappings.

I was just showing the exact indices coming from another array so OP gets a good idea.
And I was just saying that your indirection layer is highly unlikely to be correct.
You create two triangles that partially overlap and do not fill the whole quad.
29  Game Development / Game Mechanics / Re: OBJ conventions on: 2016-05-12 17:06:24
You can manipulate this to turn quadrilaterals to triangles:
1  
2  
3  
4  
int[] vertexIndicesRectangle = new int[]{1, 2, 3, 4}

int[] vertexIndicesTriangle1 = new int[]{vertexIndicesRectangle[0], vertexIndicesRectangle[1], vertexIndicesRectangle[2]}
int[] vertexIndicesTriangle2 = new int[]{vertexIndicesRectangle[1], vertexIndicesRectangle[2], vertexIndicesRectangle[3]}


This is a highly unlikely pattern.

Use {0,1,2}, {2,3,0} as mappings.
30  Discussions / General Discussions / Re: Analytics on JGO? on: 2016-05-09 14:29:37
Use HTTP, not HTTPS in your links.
Pages: [1] 2 3 ... 306
 
orrenravid (183 views)
2016-07-16 03:57:23

theagentd (253 views)
2016-07-11 14:28:54

Hydroque (336 views)
2016-07-06 05:56:57

Hydroque (488 views)
2016-07-03 08:52:54

GrandCastle (370 views)
2016-07-01 09:13:47

GrandCastle (361 views)
2016-07-01 09:09:45

CopyableCougar4 (416 views)
2016-06-25 16:56:52

Hydroque (398 views)
2016-06-22 02:17:53

SwampChicken (361 views)
2016-06-20 13:22:57

SwampChicken (297 views)
2016-06-20 13:22:49
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!