Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
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]
1  Game Development / Newbie & Debugging Questions / Re: some Garbage Collection and LWJGL memory managment questions on: 2013-09-07 17:47:49
Haha the reason I asked the third question was because I was far into my game and realized I forgot to give all the objects a delete function since then I have taken the time to add them to avoid weird errors that redocam mentioned thanks for all the information guys
2  Java Game APIs & Engines / OpenGL Development / Re: Cube is rendering faces out of order! on: 2013-09-02 07:40:41
I suggest atleast starting with vertex arrays, or VBOs


vertex buffer objects


vertex arrays


(a little outdated but much better than immediate mode)
3  Java Game APIs & Engines / OpenGL Development / Re: Cube is rendering faces out of order! on: 2013-09-02 07:37:30
This form of OpenGL rendering is very, very deprecated.

anyway add


with your init calls and make sure your


edit: beat me to it Smiley still make sure your glClear is right
4  Game Development / Newbie & Debugging Questions / some Garbage Collection and LWJGL memory managment questions on: 2013-09-01 08:55:14
Hi i have a couple questions in regards to the stuff i mentioned in the title.

Question 1:

First if i do something like

int vboID = GL15.glGenBuffers();
vboID = GL15.glGenBuffers();

would it create a memory leak?

Question 2:

I've heard a couple times that if you set big objects (such as large floatbuffers) to null after you are done using them it can speed up the java GC is this true?

and lastly,
Question 3:

in some of my lazy test code i don't delete my VBOs, VAOs, Textures, etc. at the end of the program. Ive always assumed that the OS would handle the memory deallocation like it would on regular non-openGL CPU based programs. Does the OS or the actual graphics card handle this? Or could this lead to potential problems. If it does handle it, then why bother deleting everything at the end of a program?

I know that's a lot of questions, if you happen to know any answers they would be appreciated Smiley

thanks in advance
5  Discussions / General Discussions / Re: jME: What's the Catch? on: 2013-08-27 07:44:08
When getting a Computer Science degree you must take some ASM classes. Now most people out of college will never touch ASM again for practical purposes, but what you get out of it is increased knowledge of what goes on in the computer when you press compile and run which can then be used to optimize a higher language code.

This can translate back to choosing between writing a game engine or using someone elses. Chance are any engine you write wont be as powerful as one like jMe, much as a beginners assembly code wont be nearly  as fast and efficient as that created by the compiler, but it will be a good learning experience that may help you understand the underlying processes of the game engine you are using, and help you use them better.

Understanding you tools, though not necessary, can help you implement them better.
6  Game Development / Game Mechanics / Re: [LibGDX] Calling LWJGL/OpenGL glBegin on: 2013-08-14 18:11:19
make sure your alpha blend in enabled and i would assume you would want to use 1f, 1f, 1f for your rgb's since 0f, 0f, 0f is black.
             GL11.glColor4f(1f, 1f, 1f,  intensity);
             GL11.glVertex3f(center.x,center.y, 0f);
             GL11.glColor4f(1f, 1f, 1f, 0f);
             for (float angle=0; angle<=Math.PI*2; angle+=((Math.PI*2)/subdivisions) )
               GL11.glVertex3f( radius *(float)Math.cos(angle)+ center.x,
                              radius * (float)Math.sin(angle)+ center.y, 0);  
             GL11.glVertex3f(radius + center.x, center.y, 0);

keep in mind that this method of rendering has been deprecated for a long time. with lower subdivisions it will look a little weird that's because the alpha is blended for each triangle separately making the fact that there are many different triangles apparent

edit: Just realized your talking about using LWJGL through LibGDX. dunno how you would do this in LibGDX this is just the straight LWJGL way to do it. If it exists in LibGDX i would assume it would be very similar to the above code though
7  Game Development / Newbie & Debugging Questions / Re: Is it bad practice to use the super class as a parameter. on: 2013-08-14 07:49:16
Ok i understand now Smiley, and yes that's the point of polymorphism so that is the right way to do it
8  Java Game APIs & Engines / Java 2D / Re: Efficiency in custom Map Editor - Swing or Graphics drawing? on: 2013-08-14 04:25:20
Whole point of using a JPanel is for the Swing functionality. Using a BufferedImage instead is like writing your own GUI system.

ah Ok i see where you are coming from, you are right in your own sense, but i hope you see where i'm coming from too. Also using more concrete JLabels/JPanels or a table of bufferedimages would work almost the same way which is why i mentioned it. i didnt mean cut all the scrollpane and all.
9  Java Game APIs & Engines / Java 2D / Re: Efficiency in custom Map Editor - Swing or Graphics drawing? on: 2013-08-14 04:19:25
Don't worry about efficiency too much while it's still in early development, especially since this is just a tool and not the actual game. Anyways, I don't know too much about this, but I highly doubt overriding it would be more efficient than setting it.

@Simba Productions -
That's completely off topic. He's asking about efficiency.

My question: is using Swing components like this the most efficient way of doing this?

Imho i thought drawing onto a buffered image and cut all the extra JPanels would save memory and make the program run faster, which (using Java2D) is a more efficient way of "doing this". due to the fact that its a big change from what he is doing now it could be a little too much of a change but my answer answers the question, i believe, so it isn't "completely" off topic.
10  Java Game APIs & Engines / Java 2D / Re: Efficiency in custom Map Editor - Swing or Graphics drawing? on: 2013-08-14 04:11:54
You could use a table of BufferedImage in one JPanel (instead of the jLabels), and compare speeds, or you could just create one large BufferedImage in your JPanel and just draw onto it in memory.
11  Game Development / Newbie & Debugging Questions / Re: Is it bad practice to use the super class as a parameter. on: 2013-08-14 04:00:13
Since a subclass has all the variables and methods of the superclass (though it can not necessarily access all of them) you could always use "this" instead of super which is much better practice.

I had a hard time understanding what you were trying to do with your "statecheck" function or where that function is, but maybe try putting that function in life forms or use lots of is-accessors such as "isPoisened()" in the super class and have them return booleans, and maybe interfaces like "poisonable" if not every life form can be poisoned for example.

The later way would be the most correct for a object-oriented language, but using this instead of super should suffice.
12  Game Development / Game Mechanics / Re: Ray - 3d triangle intersection test on: 2013-08-12 23:24:12
I'm still shaky on vectors so I didnt feel confident trying to find a mistake in your code.

I thought up another way to do it, by using 2D ray-plane intersection test 3x so that it would work for a 3D object

If you arent interested in another way to do it, i dont blame you, your way seems a lot more "correct" than mine and is probably more efficient, but anyway heres how i would do it

a triangle is made up of 3 points with x,y,z coordinates. a ray is just a line that is infinite in one direction.

first, i would take the x,y components of every one of the points in the triangle and break the triangle up into three lines. check if the ray intersects any of these 3 lines (once it intersects one move on to the next step ). In other words imagine flattening out the 3D object into 2D. If the line intersects it in 3D it must intersect it in 2D as well no matter which way you look at it.

second, take the y,z components of the lines of the triangles and ray, do it again.

third, x,z check intersections again.

if it intersects on every plane then the ray intersects the triangle. Again im not saying this way is "fast" or "correct". Its just the way i would do it. shouldn't kill performance too bad unless you are checking a ton of triangles.

You need to figure out an algorithm to see if two lines intersect. There are many, google is your friend.

there are also many algorithms that can quickly check if the ray even has a chance of intersecting the triangle.

Hope that wasn't too stupid an algorithm, I made that up off the top of my head when i read the title of this thread, though it will work i don't know if it'll be too fast.

Good Luck!
13  Game Development / Game Play & Game Design / Re: Switching from LibGDX to LWJGL good choice? on: 2013-08-12 20:21:57
I program using model opengl (4.x with 3.x shaders) using LWJGL.

Creating your first big game/ useful game engine is a long and grueling process, but it is also very rewarding.

In terms of the game you create, it will take you a long time of learning and a ton of code to create a game that even closely compares to the things you can probably make easily in LibGDX, so it all depends on where you want to take yourself.

If you just want to work on games and focus on the higher aspects of the game (the characters/storyline) then don't bother going to LWJGL it would not be worth it for a long time, but if you want to simply learn more about programming, are very interested in game mechanics, and if you like math/physics then LWJGL can teach you a lot and once you get over the steep learning curve it can become very rewarding.
Pages: [1]

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (57 views)
2014-04-15 18:08:23

BurntPizza (55 views)
2014-04-15 03:46:01

UprightPath (68 views)
2014-04-14 17:39:50

UprightPath (51 views)
2014-04-14 17:35:47

Porlus (68 views)
2014-04-14 15:48:38

tom_mai78101 (93 views)
2014-04-10 04:04:31

BurntPizza (153 views)
2014-04-08 23:06:04

tom_mai78101 (249 views)
2014-04-05 13:34:39

trollwarrior1 (205 views)
2014-04-04 12:06:45

CJLetsGame (213 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30 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!