Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (687)
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 ... 53
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-11-28 14:01:06
SimplyCpp now shows a nice list of compiler errors and warnings:

2  Discussions / General Discussions / Re: SMF is falling apart. on: 2015-11-18 17:28:08
This is a lot of damage to our beloved forum in my opinion. Couldn't we just upgrade SMF to a newer version?

P.S. I'd like to mention, that I'm still doing backups of JGO on my site:
3  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2015-11-09 11:42:03
Just made a bug fixing release, fixing two really important bugs: Release v0.2.7

The first bug, is the occurrence of ClassCastException when you invoke the generic any return methods (like glGetShaderParameter). GWT is returning JS integers with generics as JavascriptObject and not as expected java.lang.Integer or such, resulting in a ClassCastException being thrown. This release fixes this bug by boxing the javascript primitives into java objects which are then unboxed.

// This old code in LWJGL
-if (!glGetShaderParameterb(shaderID, GL_COMPILE_STATUS))
-    // ...

// Becomes like this in WebGL4J
+if (!WebGL10.<Boolean> glGetShaderParameter(shaderID, GL_COMPILE_STATUS))
+    // ...

The second bug, is a missing function glGetVertexAttrib() from the WebGL20 class. For some reason, I have added the native method before and not a public java method which wraps it, which this release fixes.

Another important note:

I know that the generic any return functions are inefficient due to boxing and unboxing (although GWT detects them and removes boxing and unboxing sometimes), those methods are added to keep the API similar to the javascript API. The next version v0.3.1 will be adding typed methods as alternatives.
4  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-11-05 14:40:00
Added colors to the output in TerminalWidget of SimplyCpp:

Click to Play

Also noticed the toolbar in the left of the widget?
5  Discussions / Miscellaneous Topics / Re: What are your java conventions? on: 2015-11-04 17:01:03
Mine are a mix from C/C++, Java and C#.

  • Use only 4 SPACES to indent code
  • Keep braces on their own line
  • Indent names of variables so equals signs are at same level
  • Lower camel case for methods and variables (Upper camel case in C++/C#)
  • No m_ prefix for variables (Only in except C++)
  • Spaces after keywords if/else/do/while
  • Short hand syntax of if will have the statement on next line
  • Indent the case statements in switch
  • Don't use blocks for case statements.
  • In OpenGL, add a block for statements between a glBegin and glEnd (I simulate them)
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-11-01 14:54:01
Wrote a custom
class to embed CMD in a
. See this in action:

Nice, does it work for GNU/Linux bash and Mac bash?

It should work since I didn't use any other classes or structures. I haven't tested on other OSes yet.
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-11-01 09:37:55
Wrote a custom
class to embed CMD in a
. See this in action:

Click to Play

I tried to read input from the same text control, but I can't seem to find a char typed event. So I just used two different text controls.
8  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-31 03:22:30
Added syntax highlighting and multi pane editing to SimplyCpp:

9  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-30 13:20:33
Nice. You may be interested to embedd scintilla at some point:

wxWidgets already wrap Scintilla editor into a wxScintilla project and provides wxStyledTextCtrl which wraps scintialla component into a wxWidgets widget. The good news for me, it also has a built in C++ lexer.
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-30 12:10:01
Started porting SimplyCpp from .Net C# to wxWidgets C++ so I could make it run natively on Mac OS. Also, my lecturer said it would be nice to use C++ to write a C++ editor. So I started laying out the interface in wxAUI.

The good thing is, the program remembers the locations and sizes of the panes, and the user can move them where ever he likes. Will implement tabbed multi document editing now.
11  Discussions / Miscellaneous Topics / Re: What are the viable alternatives to Sourceforge? on: 2015-10-27 13:45:02
I used to use Google code before, but since it's shutdown, I have been using GitHub and BitBucket. I use GitHub for any public projects and BitBucket for all the private ones (they offer free private repositories, unlimited). I feel that project discovery is more on GitHub than on BitBucket since it is more popular.

And for websites, I do like Jekyll but I don't use GitHub Pages as they make my website code public. Instead I'm managing my own local copy (using git with BitBucket private repository) and I'd push the pages to my server through FTP.
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-25 17:32:25
SilenceEngine now supports rendering of animated tiles in TileD maps.

Click to Play

Small GIF: 389 KB
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-24 17:05:24
Did a cartoonize texture shader in WebGL for fun which loads an image into the texture and turns it into a cartoon:

I took the main shader from Geeks3D post, and added a hue shift to it for fun.
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-23 11:56:33
On windows: Consolas
On Mac: Monaco

They're my choice.
15  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-23 09:26:13
Suggest me a good programmers font? I'm using Consolas.

I think the obvious answer is Comic Sans.

What have I done...

That's the font I hate the most. I never liked it. Comic Neue is a lot more better.
16  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-23 07:45:04
ja nice ... just the formatting .. it's a bit ... narrow Wink

I definitely agree with basil, just too small, SHC

Suggest me a good programmers font? I'm using Consolas.
17  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-23 06:23:35
Did this for a Google+ community called Programmers

Nice one right?
18  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2015-10-22 17:19:16
The idea sounds very interesting! I have been developing games both in HTML5 and Java but I never felt interested going for WebGL just yet. So if I understand the idea correctly, I am able to develop a game in Java and with some tweaks export it to HTML5? Because that would be really awesome!

That's the basic idea behind idea behind GWT, you write in Java and get that compiled to JavaScript sources which are executed in the web browser.

This library provides a binding to the WebGL API to the Java language. That means you can use Java to write your game, but you must use the WebGL bindings that this library provides to compile to HTML5. No other tweaks are required. It can be used to port Java games made using OpenGL. It doesn't support Java2D and other libraries though.

I'm not sure if I understood your reply clearly, did I answer your question? If I had misunderstood you, will you please re-phrase your question?
19  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-22 16:42:05
Installed Windows 10 today. Went better than expected. How did that process went for you guys?

Pretty good for me. Using it right from it's release. Was also an insider previously. It surprisingly took me less than 10 minutes to upgrade from Windows 8.1.
20  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2015-10-22 11:57:52
You're right, WebAL is actually very old but the API idea is quite nice, did you take a look at the IDL that defines the spec? It's pretty close to the design of WebGL. Of course it's not the complete API but the style is good. I need some more time to understand the emscripten's port of the library, but will we have permission for using their's?

And then, there is an issue with Web Audio API, it is not available in internet explorer, but it is present in Edge. Also it has some alternate function names in mobile safari. I think we should be writing our own API using Web Audio API.

By the way, this is getting off topic of thread, shall we talk about this more in PMs or IRC? I prefer IRC for this.
21  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2015-10-22 10:11:55
Quote from: kappa
This library seems pretty cool and useful for porting existing codebases to the web.

Thanks a lot! That is actually the original idea, and is why I have purposefully added the gl prefix and suffixes to the WebGL function names and made them static. With some small changes, I can say that one can port the existing codes easily.

Quote from: kappa
However the roadblock that I always run into is sound. If you could also add bindings for OpenAL that would be the final piece in making it super awesome and useful to a lot more java libraries, engines and games.

The cool thing is the EMScripten project has already implemented OpenAL in the browser (I believe it wraps the Web Audio API). Its already used by many projects including the web version of the Unreal Engine. Therefore I assume to implement a binding its just a matter of linking to the javascript methods of the Emscripten OpenAL implemention.

That's a good idea, in fact I was looking for the same thing, and I found the WebAL project, which is a new API that is almost similar to WebGL and uses WebAudio or HTML5 Audio or even a flash fallback depending on the browser support.

Take a look at this:

I however didn't test it, will do it pretty soon. I will also look into the EMScripten library that you mentioned.
22  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2015-10-22 05:42:28
Quote from: DarkCart
Is this bound to GWT? That could pose as a roadblock, as you have to use GWT for this to work.

That's like saying a Java library could pose as a roadblock, as you have to use the java compiler for that to work. GWT is a toolkit plus compiler, it compiles Java code into JavaScript code ready to be executed on the web.

Quote from: gouessej
What does your project bring compared to GwtGL, gwt-g3d and the WebGL binding of Tea VM?

GwtGL is a library I have myself used previously, and it lacks extensions and also it doesn't support WebGL context attributes. Not only that, but I find it different (even WebGL is for that matter) that it returns objects instead of integers which we the desktop users are used to. And I liked the LWJGL's design style, so I wrote this library. This has static functions which we can just static import. This makes porting LWJGL games to WebGL a lot easy, since the functions also have the same prefixes and suffixes.

gwt-g3d is a high level library, and doesn't expose WebGL directly. It provides several utility classes like Camera, Mesh, StaticMesh etc., where I myself wanted a low level library. WebGL4J will be a low level library and it allows the developer to use WebGL just like he wishes without any additional overhead.

I have not found Tea VM until today, so I really cannot say anything about it. But since it is just a Java to JS compiler just like GWT, one should compare GWT with TeaVM, and not my library with it. And I see that the classes in it's WebGL binding is very similar to GwtGL so all the things I said there apply to it.

And above all, no other library supports WebGL2 bindings till now, WebGL4J provides them too. It even provides all the Khronos ratified extensions. Another issue I find in GwtGL is it includes TypedArrays while they are present in GWT-User library itself. Above all, the last release is done in December 2011 and is showing it's age.

Quote from: gouessej
Are you allowed to use the trademark "WebGL" that way? Have you read the Khronos Group's guidelines?

I'm not sure whether I'm allowed to use it that way or not, I need suggestions on that matter. I chose this name because it brings WebGL to the Java language, so I called it WebGL4J. If it is not legal, I'm happy to change it to a legal name. Thanks for telling this so soon, it would have been difficult after some time.
23  Java Game APIs & Engines / Engines, Libraries and Tools / WebGL4J - Simple GWT based WebGL wrapper for Java on: 2015-10-21 05:58:45

WebGL4J is a WebGL wrapper library for the Java programming language which allows to use Java to write HTML5 applications using GWT (Google Web Toolkit) which uses WebGL to draw 2D / 3D hardware accelerated graphics using a HTML5 Canvas.


WebGL4J aims to provide static methods to all the WebGL functions, and also the extensions present in the Khronos WebGL Registry. This provides a similar interface to people who are coming from legacy OpenGL environments (by legacy, I mean desktop) to use WebGL easily, yet having the same interface to the users coming from JavaScript.

WebGL10Contains all the constants and functions defined in the WebGL 1.0 specification
WebGL20Contains all the constants and functions defined in the WebGL 2.0 specification
{ExtName}Contains all the constants and functions defined in the extension {ExtName}

As you have seen above, that is how the functions are structured in the wrapper, allowing to use WebGL functions from any where in the app once the context is created. All the functions have the OpenGL prefixes and suffixes, to help the users coming from the native desktop OpenGL.


Download the webgl4j.jar from releases and add it in the classpath of your GWT application. Now inherit the WebGL4J in your modules that use this library by adding the following line to your GWT module XML file.

<inherits name="com.shc.webgl4j.client" />

That should let you use WebGL4J in your project. You can now start writing WebGL applications using GWT.

Context Creation

To create a WebGL context, you can use the createContext method from the WebGL10 class or the WebGL20 class, with a canvas element from GWT.

Canvas canvas = Canvas.createIfSupported();
WebGLContext.Attributes ctxAttributes = WebGLContext.Attributes.create();

// Create the context now
WebGL10.createContext(canvas, ctxAttributes);

Don't forget to attach the canvas to the root pane or you won't be able to see it on the page. The above example creates a WebGL 1.0 context with a stencil buffer. Note that it is completely optional to pass context attributes object to the createContext method if you need none.


There are a lot of other features including multiple contexts, extensions, fullscreen support, a builtin timer etc., See the README of the GitHub project for information on using them.

Special thanks to NegativeZero for the awesome logos. The logos are under Creative Commons licence and the library is under MIT licence. If you have anything to talk, please post either here or on the IRC #WebGL4J on Freenode.
24  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-20 12:41:51
I think I'm just going to use the logo made by NegativeZero, they're really really cool, thanks a lot. I personally like the orange and the green versions. Purple and blue are fine too, but I somehow like these two the most among them. By the way, can you provide transparent versions for the dark style images please? Also can you use capitals for W and J in the name? It is WebGL4J and not webGL4j. Other then that, this is so perfect.

As you asked, I'll give credit to your Twitter. Thanks a lot for this.

I'll be making a forum post about this soon, but am not sure where I should be posting due to the recent change in rules regarding libraries. This is a low level library that provides bindings to WebGL functions and doesn't do anything else. A few utilities like timing functions and fullscreen polyfills are added.
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-20 03:13:56
Thanks a lot for choosing (a) which I like the most. After this poll, my anonymous (Drenius didn't want me to say his name publicly here, so anonymous) friend suggested me to use different colors (RGB) so here is that version too.

Which one do you guys like better? I'm unable to select from them, they both look good.
26  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-19 15:59:47
Yeah sure. If you want it on a transparent background and any other changes just say. You can have the .blend I rendered it from also if you'd like.

I just want to keep it as a token of history, it looked so cool. But for the project itself, I went with (a) since most recommended it to me over the other versions.
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-19 06:22:48

Wow, that's pretty awesome! Can I take it?
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-19 05:19:46
I have tried to make a logo with the help of a friend Drenius for WebGL4J, a WebGL wrapper for Java.

(a):    (b): (c):

I personally prefer (a) and (c), and would like to know opinions of others too. Which one do you prefer most? Also any suggestions are appreciated.
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-11 18:11:01
Found a new way to use generics in Java for solving a problem with WebGL, having a function return data in different types depending on a parameter name. This is possible in JS with duck typing, but generics allowed that in Java too with Java 7.

For example: This is the code I wrote using generics for the glGetParameter() method in WebGL10 class. This does convert the objects into integers as they are represented as integers in desktop OpenGL (chosen to look like LWJGL classes since it makes it easy for me to port to WebGL in the end).

public static <T> T glGetParameter(int pname)
    T result = nglGetParameter(pname);

    switch (pname)
            return (T) (Integer) WebGLObjectMap.get().createBuffer((JavaScriptObject) result);

        case GL_CURRENT_PROGRAM:
            return (T) (Integer) WebGLObjectMap.get().createProgram((JavaScriptObject) result);

            return (T) (Integer) WebGLObjectMap.get().createFramebuffer((JavaScriptObject) result);

            return (T) (Integer) WebGLObjectMap.get().createRenderBuffer((JavaScriptObject) result);

        case GL_TEXTURE_BINDING_2D:
            return (T) (Integer) WebGLObjectMap.get().createTexture((JavaScriptObject) result);

    return result;

The above allows one to use it to take multiple parameters, as like in this example.

int          texture    = glGetParameter(GL_TEXTURE_BINDING_2D);
boolean      blending   = glGetParameter(GL_BLEND);
Float32Array blendColor = glGetParameter(GL_BLEND_COLOR);

This is similar to how people use WebGL from the native JavaScript too, where the var keyword is used instead of the return types. Interested, I thought how this will be output in JS by the GWT compiler. This is the version without optimisations in SuperDev mode.

function glGetParameter_0_g$(pname_0_g$){
  var result_0_g$;
  result_0_g$ = nglGetParameter_0_g$(pname_0_g$);
  switch (pname_0_g$) {
    case 34964:
    case 34965:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createBuffer_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
    case 35725:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createProgram_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
    case 36006:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createFramebuffer_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
    case 36007:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createRenderBuffer_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
    case 32873:
    case 34068:
      return dynamicCastAllowJso_0_g$(dynamicCast_0_g$(valueOf_60_g$(get_40_g$().createTexture_1_g$(dynamicCastJso_0_g$(result_0_g$))), 1480), 1);
  return result_0_g$;

It is almost the same, but the call to nglGetParameter, a method that is written using JSNI is still not inlined. So I thought verifying the optimised output of the method and setting the compile style to pretty for this input:

int result = glGetParameter(GL_TEXTURE_BINDING_2D);
GWT.log("" + result);

It inlined the code perfectly, even from the parameter it judged what type I was trying to create and inlined the casts as well, producing the following version:

result = $;
valueOf($createTexture(get_2(), dynamicCastJso(result)));

The piece where $ is actually part of nglGetParameter method which is the JSNI method, and it got inlined into the glGetParameter method, which itself is inlined into the onModuleLoad method which is the entry point. This is extremely good, I was initially worried about the overhead my library introduces, but it turned out that there is no overhead actually!

It started with the question on how to write the Java function for the IDL
any getParameter(GLenum pname)
that made me look into generics, and took me to verify the contents of the generated JS by the compiler. Learnt this today.
30  Java Game APIs & Engines / OpenGL Development / Re: Standard Game Loops for lwjgl? on: 2015-10-10 04:37:55
Correction: The Display class is no longer in LWJGL 3. People who do have a Display class simply wrap the GLFW functions in their own wrapper. IIRC SHC did this at one point.

I'm still using the Display class I wrote once in my SilenceEngine. However, I kept the GLFW functions in their own classes such as Window, Monitor, etc., and the Display supports switching windows (between fullscreen and normal mode).
Rest of GLFW classes
Pages: [1] 2 3 ... 53
Dwinin (72 views)
2015-11-07 13:29:08

Rems19 (81 views)
2015-10-31 01:36:56

Rems19 (74 views)
2015-10-31 01:32:37

williamwoles (107 views)
2015-10-23 10:42:59

williamwoles (93 views)
2015-10-23 10:42:45

Jervac_ (107 views)
2015-10-18 23:29:12

DarkCart (135 views)
2015-10-16 00:58:11

KaiHH (116 views)
2015-10-11 14:10:14

KaiHH (156 views)
2015-10-11 13:26:18

BurntPizza (171 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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‑
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!