Java-Gaming.org Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (679)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (734)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 3 [4] 5 6 ... 10
 31 
 on: 2016-05-28 16:37:45 
Started by BurntPizza - Last post by ags1
Started making movement trays for my rat army. Looking forward to my first game of warhammer in 30 years Smiley


 32 
 on: 2016-05-28 13:22:15 
Started by arkisvir - Last post by J0
Hi!
I'm wondering, what kind of physics engine are you using / planning to use?
Is it going to be realistic — for example, continuous motion in space until a counter force is applied — or simplified — automatic stabilization of spaceship such as to leave it motionless relative to nearby planets? Are your planets / stars / etc going to follow physics as well, orbiting other bodies, or will they be motionless?
J0 Smiley

Edit: Also, on that gif you posted, are the other bodies (i.e. the pulsar, planets, clouds) close or really far from the ship?

 33 
 on: 2016-05-28 12:59:10 
Started by useless - Last post by theagentd
Create a debug context and add a debug callback. glGetError() both gives you very little information and reduces performance by forcing the driver to run single-threaded.

 34 
 on: 2016-05-28 12:51:36 
Started by useless - Last post by useless
Whats a good way to catch gl errors? I guess calling glGetError after every gl function call is not something you guys do?

 35 
 on: 2016-05-28 11:03:05 
Started by noctarius - Last post by VaTTeRGeR
Java 8 allows default implementations for interface methods, but (i think) interface fields are static final by default.

Quote from: Icecore
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
class AA extends B,C,D{
}
class BB extends B,C,D{
}

fun(B data){
    do_B(data);
    if(data instanceof C){
        do_C(data);
    }
    if(data instanceof D){
        do_D(data);
    }
}
<T extends B & C & D> fun(T data){
    do_B(data);
    do_C(data);
    do_D(data);
}


I don't see a logical problem with this example.
You can also check if an interface is present on a class that might or might not have it, just like in your example where an instance of B might also have an implementation of C or/and D. Does it really make a difference whether the implementation is provided by implementing an interface or using multiple inheritance?


Quote from: Icecore
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
   class B_Data{}
   class C_Data{}
   class D_Data{}
   
   interface B{public B_Data get_B_Data();}
   interface C{public C_Data get_C_Data();}
   interface D{public D_Data get_D_Data();}
   class AA implements B, C, D{
      B_Data bd;
      public B_Data get_B_Data(){return bd;}
      C_Data cd;
      public C_Data get_C_Data(){return cd;}
      D_Data dd;
      public D_Data get_D_Data(){return dd;}
     
      public<T extends B & C & D> void Fun(T data){
         do_B(data);
         do_C(data);
         do_D(data);
      }
      public void do_B(B data){}
      public void do_C(C data){}
      public void do_D(D data){}
   }

What you think?)

I had to do something like this for adding versioning functionality to a class that was already extending a framework specific class, this is not the best example because it was only one addition to that class, but there sure is a use for multiple inheritance.

The interface version requires copy-pasting code around which is annoying, error-prone and time-consuming.
Most of these cases (and also my example) could be solved with simple inheritance, but deep class hierarchies kinda suck and are inflexible, it just doesn't feel right to me to create a new class branch just to add a component to some class.

 36 
 on: 2016-05-28 10:03:14 
Started by useless - Last post by theagentd
Yep, in early OpenGL versions GL_RGBA was a valid internal format, which indicated that the driver was free to choose the precision of the internal format. Theoretically the driver could choose GL_RGBA4 for example, but in practice GL_RGBA is just an alias for GL_RGBA8. For glTexStorage2D() they just made the API more explicit and disallowed GL_RGBA it seems.

You really should use a debug context to avoid missing OpenGL errors. You may even have gotten an exact error message detailing what you did wrong in this case.

EDIT: On Nvidia driver:
Quote
[LWJGL] ARB_debug_output message
   ID: 1280
   Source: API
   Type: ERROR
   Severity: HIGH
   Message: GL_INVALID_ENUM error generated. Internal format not supported.
   Stack trace:
java.lang.Exception: Stack trace
   at java.lang.Thread.dumpStack(Thread.java:1329)
   at engine.util.gl.debug.DebugCallbackHandler.invoke(DebugCallbackHandler.java:87)
   at org.lwjgl.opengl.GLDebugMessageARBCallback.callback(GLDebugMessageARBCallback.java:44)
   at org.lwjgl.system.JNI.callIIIIIV(Native Method)
   at org.lwjgl.opengl.GL42.glTexStorage2D(GL42.java:302)
   at random.test.DebugContextTest.main(DebugContextTest.java:37)

 37 
 on: 2016-05-28 09:31:31 
Started by DrHalfway - Last post by basil_
http://dsiutils.di.unimi.it/ comes with a pretty complete input/output bit-stream. some of the more exotic encodings are interesting.

http://dsiutils.di.unimi.it/docs/it/unimi/dsi/io/package-summary.html

http://dsiutils.di.unimi.it/docs/it/unimi/dsi/io/InputBitStream.html
http://dsiutils.di.unimi.it/docs/it/unimi/dsi/io/OutputBitStream.html

 38 
 on: 2016-05-28 09:24:30 
Started by useless - Last post by useless
Good to know, and it works, i removed the gltexparametri completely now. Only have the new texture upload approach. If i fix the sized internal format thingy the whole thing looks solid.

 39 
 on: 2016-05-28 09:21:40 
Started by useless - Last post by theagentd
To explain why glTexParameteri() wasn't necessary with glTexStorage2D():

When glTexImage2D() is called the default values for BASE_LEVEL and MAX_LEVEL are these:
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_BASE_LEVEL, 0);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_LEVEL, 999);

When glTexStorage2D() is called the default values are:
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_BASE_LEVEL, 0);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_LEVEL, mipmaps-1);

In other words, when glTexStorage2D() is used all mipmaps are allocated and the MAX_LEVEL parameter is set to include those mipmaps. With only 1 level in the texture, the texture is always complete regardless of the filtering used as all mipmaps up to MAX_LEVEL-1 are defined and ready.

 40 
 on: 2016-05-28 09:13:53 
Started by useless - Last post by useless
The error was 1280.

According to internet its an unsupported enum value passed to a gl function.

And that fits to what kaiHH says, if i replace RGBA with RGBA8 the whole thing works.

Thanks guys for all the answers, learned a few things. This thread can be marked solved,

Pages: 1 2 3 [4] 5 6 ... 10
 
DarkCart (16 views)
2016-05-29 02:30:33

Hydroque (33 views)
2016-05-26 14:45:46

Mac70 (45 views)
2016-05-24 21:16:33

theagentd (49 views)
2016-05-14 18:38:35

theagentd (83 views)
2016-05-10 22:37:41

theagentd (89 views)
2016-05-10 22:33:46

IanParcs (117 views)
2016-04-18 14:18:53

KaiHH (114 views)
2016-04-18 08:35:41

KaiHH (135 views)
2016-04-15 12:43:58

theagentd (140 views)
2016-04-14 02:16:17
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

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50
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!