Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (581)
Games in Android Showcase (162)
games submitted by our members
Games in WIP (632)
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
1  Discussions / Miscellaneous Topics / Re: What are your current personal projects? on: 2015-05-23 11:13:05
When I have time I'm working on a game project that also happens to be my childhood dream. Smiley
Apart from that I have a few other projects in mind like some other game ideas or a few NetBeans plugins.
Every now and then I'm learning some japanese Kanji.

But currently I'm implementing the last few parts of my bachelor thesis.
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-20 17:22:13
Held a lecture about the framework of my thesis at the Colloquium of our University.
Most of my fellow student know nothing about modern OpenGL Clueless

R.I.P. Ralphie, I will miss you and I love you. You were an amazing friend and a great dog. Thank you for anyone who took the time to read this, I really needed to write something about it.
That's sad to hear, you have my sympathy. Sad
3  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-15 20:43:29
Submitted the first draft of my bachelor thesis on the concept of a framework for teaching shader-based OpenGL Smiley
4  Java Game APIs & Engines / OpenGL Development / Re: Resources for OpenGL 3.3+ and LWJGL? on: 2015-05-06 11:43:23
You could take a look at the list of learning ressources here on JGO, there are some good tutorials listed.
Especially this one helped me the most when starting to learn modern OpenGL.

Some time ago I made an tutorial for LWJGL3 with OpenGL 3.2 core profile, you may want to take a look here.

Hope that helped Smiley
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-12 12:05:50
Why not going for a real challenge? Cheesy
6  Game Development / Newbie & Debugging Questions / Re: I want to use VBO instead of depreciated immediate mode.. any senior advice? on: 2015-02-05 22:01:48
It depends what you want to do with the VBOs, you could try using legacy OpenGL with client-side capabilities.
But I would recommend to learn shader programming, even if you have a GPU that only supports OpenGL 2.1.

The list of learning resources have some modern OpenGL tutorials if you want to learn shader programming.
This one helped me a lot with writing my first shaders. You could also look into my tutorial for LWJGL3, but that is still a work-in-progress.

Hope that helps Smiley
7  Game Development / Newbie & Debugging Questions / Re: LWJGL - White box instead of texture on: 2015-01-27 19:09:49
That shouldn't make a difference if you are on Linux or another OS, did that code throw an exception?

Just saw that you are creating a vertex shader, does the code work if you comment that part out?
You may also wan't to try abandoning that legacy OpenGL and start to work with shaders.
I started writing a tutorial some weeks ago for LWJGL3, you could look at it here.
Hope that helps Smiley
8  Game Development / Newbie & Debugging Questions / Re: LWJGL - White box instead of texture on: 2015-01-27 17:36:17
After deeper examination, I noticed that the byte buffer is empty. Let me see if I can override one of the functions in the PNG decoder to make it return it's value instead.

Well in that case you could load the picture with
ImageIO
and put the data into the buffer yourself.
Here's an example code of how you could load your image Wink

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
BufferedImage image = null;
try {
    InputStream in = this.getClass().getResourceAsStream("textures/" + name + ".png");
    image = ImageIO.read(in);
} catch (IOException ex) {
    throw new RuntimeException("Failed to load a texture file!"
        + System.lineSeparator() + ex.getMessage());
}
if (image != null) {
    /* Get width and height of image */
    int width = image.getWidth();
    int height = image.getHeight();

    /* Get pixel data of image */
    int[] pixels = new int[width * height];
    image.getRGB(0, 0, width, height, pixels, 0, width);

    /* Put pixel data into a ByteBuffer */
    ByteBuffer buffer = BufferUtils.createByteBuffer(width * height * 4);
    for (int y = 0; y < height; y++) {
        for (int x = 0; x < width; x++) {
            /* Pixel as RGBA: 0xAARRGGBB */
            int pixel = pixels[y * width + x];

            /* Red component 0xAARRGGBB >> 16 = 0x0000AARR */
            buffer.put((byte) ((pixel >> 16) & 0xFF));

            /* Green component 0xAARRGGBB >> 8 = 0x00AARRGG */
            buffer.put((byte) ((pixel >> 8) & 0xFF));

            /* Blue component 0xAARRGGBB >> 0 = 0xAARRGGBB */
            buffer.put((byte) (pixel & 0xFF));

            /* Alpha component 0xAARRGGBB >> 24 = 0x000000AA */
            buffer.put((byte) ((pixel >> 24) & 0xFF));
        }
    }

/* Do not forget to flip the buffer! */
buffer.flip();

} else {
    throw new RuntimeException("File extension not supported!"
        + System.lineSeparator() + "The following file extensions "
        + "are supported: "
        + Arrays.toString(ImageIO.getReaderFileSuffixes()));
}
9  Game Development / Newbie & Debugging Questions / Re: LWJGL - White box instead of texture on: 2015-01-27 16:48:59
Don't know about that PNGDecoder, if it decodes the image to the right format, so I just assume, that the ByteBuffer is filled with the right data.

In your rendering code I see, that you use
texture.getTextureHeight()
, but Texture coordinates go from 0.0 to 1.0 so change your rendering to this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
glBegin(GL_QUADS);
{
    glTexCoord2d(0, 0);
    glVertex2d(0, 0);

    glTexCoord2d(0, 1);
    glVertex2d(0, texture.getImageHeight());

    glTexCoord2d(1, 1);
    glVertex2d(texture.getImageWidth(), texture.getImageHeight());

    glTexCoord2d(1, 0);
    glVertex2d(texture.getImageWidth(), 0);
}
glEnd();


Does that solve your problem? Smiley
10  Game Development / Newbie & Debugging Questions / Re: JAR File isn't being written correctly on: 2015-01-21 10:38:29
For reading and writing *.jar files I would take a look at JarInputStream and JarOutputStream.
Did you have already tried that? Smiley
11  Game Development / Newbie & Debugging Questions / Re: Sprite Sheet Instruction Needed on: 2015-01-13 20:51:04
glTexCoord
takes the parameters
(S, T)
. As such, the bottom left is
(0, 0)
, the bottom right is
(0, 1)
, the top left is
(1, 0)
and the top right is
(1, 1)
.
I think bottom right is
(1,0)
and top left is
(0,1)
Smiley
12  Java Game APIs & Engines / OpenGL Development / Re: Lwjgl Error: Failed to load the native library: lwjgl on: 2014-12-19 17:09:13
When you get that error, then you haven't set the
org.lwjgl.librarypath
correctly.
You could copy the native folder to the folder that contains the jar. Then in your main method do this:

1  
2  
3  
4  
5  
if (System.getProperty("org.lwjgl.librarypath") == null) {
    Path path = Paths.get("native");
    String librarypath = path.toAbsolutePath().toString();
    System.setProperty("org.lwjgl.librarypath", librarypath);
}


Does this work for you? Smiley
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-12-19 11:27:23
Started a LWJGL3 Tutorial Smiley
Oh and also made my 40th post on JGO right now Cheesy
14  Games Center / WIP games, tools & toy projects / Re: Legends of Fore on: 2014-11-28 11:17:19
That Google German translation is horrible, it should be:

"Hallo, willkommen auf dem Titan, wir führen hier archäologische Forschungen durch."
"Danke" - "Was?"

What about a Japanese translation? Cheesy
15  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-26 11:15:56
Had a meeting with my Computer Graphics professor to talk about my thesis Smiley
16  Game Development / Game Play & Game Design / Re: Where can I get nice spritesheets and images? on: 2014-11-19 13:45:33
You can find a lots of links at gamedev.stackexchange.com.
Maybe you'll find something like that Smiley
17  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-14 17:22:42
Installed Linux Mint 17 on VirtualBox to test it out.
Seems like an alternative to Windows! Cheesy
18  Discussions / General Discussions / Re: Someone pick my license! on: 2014-11-10 08:43:54
I would look here or here.

I think this one would be your best bet!
Quote
Under the following terms:
  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • NonCommercial — You may not use the material for commercial purposes.
  • NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.
  • No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

Or you could write your own license of course Wink

Hope that helps a bit Smiley
19  Game Development / Newbie & Debugging Questions / Re: Best way to iterate through ArrayList? on: 2014-10-17 21:40:27
If you think that's crazy...
Didn't want to make it too complicated Cheesy
20  Game Development / Newbie & Debugging Questions / Re: Best way to iterate through ArrayList? on: 2014-10-17 21:33:41
Streams are probably my new favorite way of going through some Collection to perform operations on it. They're like LINQ for Java! Smiley

I like Streams too, so if you use Java 8 you can use them!

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
// One Operation
array.stream().forEach(val -> val.doSomething());

// Multiple Operations:
array.stream().forEach(val -> {
    val.doSomething();
    val.doSomeOtherThings();
});

// You could even make crazy things like this:
array.stream().filter(val -> val.isAThing())
              .forEach(thing -> thing.doSomething());

Just wanted to show some examples for this Wink
For some more methods you can look into the Java Doc.
21  Game Development / Game Mechanics / Re: Connected Textures? on: 2014-09-28 17:18:49
Here's another tutorial for tiling:
http://www.angryfishstudios.com/2011/04/adventures-in-bitmasking/

There's also an example for the 8-bit case Wink
22  Discussions / General Discussions / Re: Looking for a good and detailed lwjgl tutorial on: 2014-08-16 09:28:48
There is also the List of Learning Resources here on JGO!
You can find some good tutorials there Wink
23  Game Development / Newbie & Debugging Questions / Re: Levels rendered sideways? on: 2014-07-27 09:42:25
That's because OpenGL has its origin in the lower left corner.
Like trollwarrior1 said already you could flip the y Coordinate with
screenHeight - y;
or else you could just initalize OpenGL with
glOrtho(0, screenWidth, screenHeight, 0, -1, 1);
, then you have your origin in the top left.
There's nothing wrong with changing the orthographic projection Wink
24  Discussions / General Discussions / Re: New feature: Embedded PDFs on: 2014-07-19 16:48:02
Sadly this feature don't work on Opera - even though it is using the same engine as Chrome. After clicking "click this page to load the PDF" download is initalized, but nothing appears.
I'm using Opera 12.17 (64-bit) and it works fine for me Smiley
Don't know if there's a different engine with other versions.
25  Game Development / Newbie & Debugging Questions / Re: LWJGL BufferedImage white image on: 2014-07-13 11:37:32
Hmmm, still not working...
Just saw that you do
glLoadIdentity()
between
glBegin(...)
and
glEnd()
.

You'll get an OpenGL Error when doing this:
GL_INVALID_OPERATION is generated if glLoadIdentity is executed between the execution of glBegin and the corresponding execution of glEnd.

So does it work if you delete that
glLoadIdentity()
? Smiley
26  Game Development / Newbie & Debugging Questions / Re: LWJGL BufferedImage white image on: 2014-07-13 10:49:52
You haven't set your texture scaling parameters.
Try calling this between
GL11.glBindTexture(...)
and
GL11.glTexImage2D(...)
:

1  
2  
3  
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
// Alternatively you could use GL11.GL_LINEAR instead of GL11.GL_NEAREST

After that you should see your texture Wink

Also you should do
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID)
before drawing your image.
Hope that helped Smiley
27  Game Development / Newbie & Debugging Questions / Re: Rectangles not drawn after Texture is initialized on: 2014-06-12 23:23:06
Ha. But I didn't actually draw the texture yet. When I do it gets rid of the rectangle. That's the problem.
Do you bind your texture? Roll Eyes
And instead of
glRectf(x1, y1, x2, y2)
you could try this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
// Note: This method assumes that x1 < x2 and y1 < y2, and also that the texture origin is bottom left.
public void drawRect(float x1, float y1, float x2, float y2) {
    glBegin(GL_QUADS);
        glTexCoord2f(0f, 0f);
        glVertex2f(x1, y1);
        glTexCoord2f(1f, 0f);
        glVertex2f(x2, y1);
        glTexCoord2f(1f, 1f);
        glVertex2f(x2, y2);
        glTexCoord2f(0f, 1f);
        glVertex2f(x1, y2);
    glEnd();
}

Before calling
drawRect(x1, x2, y1, y2)
you should do
glBindTexture(GL_TEXTURE_2D, textureId)
.
Does that solve your problem? Smiley
28  Game Development / Newbie & Debugging Questions / Re: Should I use Java Observer? on: 2014-06-11 14:10:09
Well the benefit from using the Java Observer is, that you don't have to write it yourself Roll Eyes

The only things you would have to do:
  • Create your Entity class (extends java.util.Observable)
  • Create an EntityObserver class (implements java.util.Observer)
  • When creating a entity do
    entity.addObserver(observer)
  • When a change in your entity happens do
    setChanged()
    and
    notifyObservers()

I wouldn't bother writing your own Observer pattern Wink
29  Discussions / General Discussions / Re: [Swing] Can swing look sexy? on: 2014-05-28 17:24:06
JavaFX is supposedly the future, but so far it's a *tumbleweed* - who's making anything beyond trivial demos with it?
I'm making a WM 2014 Live Ticker for a lecture project... then again, it is a trivial application... Roll Eyes
It probably won't even be completed because my teammates are rather lazy... I neither have the will nor the time to program their parts too Emo

In the end I still prefer Swing over JavaFX.
30  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2014-05-25 10:04:12
There was a good tutorial that I found (though I can't find it again) that explained how to use powers of two.

The first tutorial that comes to my mind is this one.
Is that the tutorial you had in mind? Smiley
Pages: [1] 2
 
MrMapcom (16 views)
2015-05-23 20:26:16

MrMapcom (22 views)
2015-05-23 20:23:34

Waterwolf (29 views)
2015-05-20 15:01:45

chrislo27 (36 views)
2015-05-20 03:42:21

BurntPizza (71 views)
2015-05-10 15:53:18

FrozenShade (56 views)
2015-05-07 09:11:21

TheLopais (219 views)
2015-05-06 13:36:48

TheLopais (202 views)
2015-05-06 13:35:14

TheLopais (207 views)
2015-05-06 13:33:39

TheLopais (228 views)
2015-05-06 13:32:48
List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00
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!