Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (498)
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  Java Game APIs & Engines / JOGL Development / Re: simple transparency on: 2006-08-07 01:11:28
There's a difference between transparent and translucent.
An alpha channel is used to define the opacity of every single pixel of an image, this is (relatively) rarely used, while a single transparent color (sup "magic pink") is just a simple transparency for non-rectangular sprites etc, this can be found everywhere, like here -> Smiley, that's why I expected opengl to have some way to set one transparent color for textures...
2  Java Game APIs & Engines / JOGL Development / Re: simple transparency on: 2006-08-05 16:16:53
so I do need RGBA textures, just to get a single transparent color?

also, I take it you mean SRC_ALPHA and ONE_MINUS_SRC_ALPHA?

\\ edit

well, it works with alpha channel... but that's a bit overkill, isn't it? :|
3  Java Game APIs & Engines / JOGL Development / simple transparency on: 2006-08-05 03:49:19
Ok, I've been reading tutorials (nehe, jumping into, redbook, forum search...) for hours now, and I can't find a solution to this simple problem:
How do I get simple transparent backgrounds for my textured sprites?!

I convert a texture with black background (RGB), and I can't get it to be displayed correctly with transparent background. If I use blending with GL_ONE/GL_ONE or whatever else, it's transparent all right, but the sprites are blended together, too, not drawn on top of each other!

do I really need to use RGBA sprites to have a single transparent color?! I guess it's something incredibly trivial I just fail to see... Tongue
4  Java Game APIs & Engines / JOGL Development / Re: INVALID_OPERATION on: 2006-08-04 12:43:42
changed the code a bit to have all gl calls in one sequence.

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  
48  
49  
50  
51  
        // go through queue and draw
       // !!! I changed this. there are no ogl calls in here at all now, only thing it does is generate the bytebuffer
        if(blah == null)
            while(!queue.isEmpty())
                // draw each element of this
                queue.remove().draw(this);

        try {

            gl.glMatrixMode(GL.GL_MODELVIEW);
            gl.glLoadIdentity();
            gl.glTranslatef(0.0f,0.0f,-5.0f);

            if(blah == null) {

                gl.glBindTexture(GL.GL_TEXTURE_2D, 0);

                gl.glBegin(GL.GL_QUADS); {
                    gl.glColor3f(1.0f, 0.0f, 0.0f);
                    gl.glVertex3f(-1.0f, -1.0f1.0f);
                    gl.glVertex3f( 1.0f, -1.0f1.0f);
                    gl.glVertex3f( 1.0f1.0f1.0f);
                    gl.glVertex3f(-1.0f1.0f1.0f);
                } gl.glEnd();

            } else {
                // results in a call glBindTexture with id 1, nothing wrong here
                blah.bind(gl);

                blah.textureBuffer.rewind();
                // !!! in this line (below), an exception is shown, see below. wtf!
                gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, blah.texWidth, blah.texHeight, 0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, blah.textureBuffer);

                gl.glColor3f(0.0f, 1.0f, 1.0f);

                gl.glBegin(GL.GL_QUADS); {

                    gl.glTexCoord2f(0.0f, 0.0f);
                    gl.glVertex3f(-1.0f, -1.0f1.0f);

                    gl.glTexCoord2f(1.0f, 0.0f);
                    gl.glVertex3f( 1.0f, -1.0f1.0f);

                    gl.glTexCoord2f(1.0f, 1.0f);
                    gl.glVertex3f( 1.0f1.0f1.0f);

                    gl.glTexCoord2f(0.0f, 1.0f);
                    gl.glVertex3f(-1.0f1.0f1.0f);

                } gl.glEnd();
            }



exception thrown:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
java.lang.NullPointerException
   at com.sun.opengl.impl.FunctionAvailabilityCache$Version.<init>(FunctionAvailabilityCache.java:296)
   at com.sun.opengl.impl.FunctionAvailabilityCache.initAvailableExtensions(FunctionAvailabilityCache.java:133)
   at com.sun.opengl.impl.FunctionAvailabilityCache.isExtensionAvailable(FunctionAvailabilityCache.java:104)
   at com.sun.opengl.impl.GLContextImpl.isExtensionAvailable(GLContextImpl.java:337)
   at com.sun.opengl.impl.GLImpl.isExtensionAvailable(GLImpl.java:27851)
   at com.sun.opengl.impl.GLImpl.initBufferObjectExtensionChecks(GLImpl.java:27994)
   at com.sun.opengl.impl.GLImpl.checkUnpackPBODisabled(GLImpl.java:28027)
   at com.sun.opengl.impl.GLImpl.glTexImage2D(GLImpl.java:19578)
   at javax.media.opengl.DebugGL.glTexImage2D(DebugGL.java:8445)
   at com.mugenguild.vMugen.graphics.OglDisplay.display(OglDisplay.java:250)
   at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78)
   at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:281)
   at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194)
   at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:298)
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)


I have absolutely no idea what this could mean. The ByteBuffer is not null (I checked in the debugger, it's all how it's supposed to be, and also the nullpointerexception doesn't occur at the rewind), texwidth results to 64, texheight results to 128, all other parameters are constants. there were no exceptions caught where this call was made before

also, the exception looks more like a function is missing or something within the ogl libs... hum. any ideas?

Quote
Heh, wasn't sure if it would affect it or not, maybe I shouldn't be giving advice as a JOGL newb

no, why? it was an idea, and you learned something. nothing wrong there Wink


\\ edit

almost the same error msg here, so I guess it's not my code that is causing the problem...
http://www.java-gaming.org/forums/index.php?topic=13705.0

Smiley

\\\ edit

ARRGH!!!

I forgot to put a glEnd() at the end of a drawLine call, which I didn't even know was executed!! this, and the bug, made up for a perfect combination to keep me entertained, really >_<

\\\\ edit

f**kin' woot. it's working now. thanks, everyone =)
5  Java Game APIs & Engines / JOGL Development / Re: INVALID_OPERATION on: 2006-08-04 01:53:54
No brackets, not sure if this is what the problem is tho

you can use brackets whereever you like, with local vars and stuff. and for indentation and readability, I think putting glBegin and glEnd into brackets makes sense Smiley

Quote
Since you aren't getting an OpenGL error earlier in your execution you need to trim down your rendering until you isolate exactly the sequence of calls provoking the error. It isn't obvious from the code you posted where the error is (or in fact if the error is there or in another part of your code, for example the texture handling code).

well, it more or less is. the queue loop (almost) directly calls the texture binding code. I'll try to get it all in a sequence like you said, though. Thanks for helping Smiley
6  Java Game APIs & Engines / JOGL Development / INVALID_OPERATION on: 2006-08-03 20:00:43
Okay... I got this error, and I have absolutely no clue what it might be caused by. My code is more or less directly taken from NeHe tutorial jogl example code, since I've gone back step by step in order to track that bug. Didn't work out.

Some code:
init function, should be self-explaining
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
        this.drawable = drawable;
        // we do this manually (in show()), so it's steadily done at the end of each tick
        drawable.setAutoSwapBufferMode(false);

        // get generic GLU :)
        this.glu = new GLU();

        drawable.setGL(new DebugGL(drawable.getGL()));
        this.gl = drawable.getGL();

        gl.glEnable(GL.GL_TEXTURE_2D);
        gl.glShadeModel(GL.GL_SMOOTH);
        gl.glClearDepth(1.0f);
        gl.glEnable(GL.GL_DEPTH_TEST);
        gl.glDepthFunc(GL.GL_LEQUAL);

        this.gl = null;



display method, interesting comments with !!!
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  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
        // get surface
        gl = drawable.getGL();
       
        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);

        // go through queue and draw

        // !!! in the second tick, the texture gets generated and bound here. nothing else to say, all other functionality gone for debugging
        if(blah == null)
            while(!queue.isEmpty())
                // draw each element of this
                queue.remove().draw(this);

        try {

            gl.glMatrixMode(GL.GL_MODELVIEW);
            gl.glLoadIdentity();
            gl.glTranslatef(0.0f,0.0f,-5.0f);

            // !!! blah is the texture (wrapped up in a simple class), in the first tick it's null, (draws red square), second tick it's there
            if(blah == null) {

                gl.glBindTexture(GL.GL_TEXTURE_2D, 0);

                gl.glBegin(GL.GL_QUADS); {
                    gl.glColor3f(1.0f, 0.0f, 0.0f);
                    gl.glVertex3f(-1.0f, -1.0f1.0f);
                    gl.glVertex3f( 1.0f, -1.0f1.0f);
                    gl.glVertex3f( 1.0f1.0f1.0f);
                    gl.glVertex3f(-1.0f1.0f1.0f);
                } gl.glEnd();

            } else {


                gl.glColor3f(0.0f, 1.0f, 1.0f);
                // !!! simply binds texture, nothing else. checked a thousand times for errors
                blah.bind(gl);

                gl.glBegin(GL.GL_QUADS); {

                    // !!! code 1:1 from tutorial, the square is shown, but it's plain color
                    gl.glTexCoord2f(0.0f, 0.0f);
                    gl.glVertex3f(-1.0f, -1.0f1.0f);

                    gl.glTexCoord2f(1.0f, 0.0f);
                    gl.glVertex3f( 1.0f, -1.0f1.0f);

                    gl.glTexCoord2f(1.0f, 1.0f);
                    gl.glVertex3f( 1.0f1.0f1.0f);

                    gl.glTexCoord2f(0.0f, 1.0f);
                    gl.glVertex3f(-1.0f1.0f1.0f);

                // !!! this glEnd gives the error (see below), but only in the tick after the texture is generated. after that, a solid square is drawn.
                } gl.glEnd();
            }
        } catch (GLException e) {
            e.printStackTrace();
        }

       // pass stuff to graka
        gl.glFlush();

        // make sure outside this procedure, no gl is called.
        gl = null;


reshape
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
        this.gl = drawable.getGL();

        final float h = (float)width / (float)height;

        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glLoadIdentity();
        glu.gluPerspective(45.0f, h, 1.0, 20.0);
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();

        this.gl = null;


texture making code, only the important bits. everything else is a-ok.
1  
2  
3  
4  
5  
6  
7  
        // !!! serialized the byte[] array and put into the lesson06 code, it works, so up to here it's all right.
        imageBuffer = ByteBuffer.allocateDirect(data.length);
        imageBuffer.order(ByteOrder.nativeOrder());
        imageBuffer.put(data, 0, data.length);

        imageBuffer.rewind();
        gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, texWidth, texHeight, 0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, imageBuffer);


given error
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  
javax.media.opengl.GLException: glGetError() returned the following error codes after a call to glEnd(): GL_INVALID_OPERATION 
   at javax.media.opengl.DebugGL.checkGLGetError(DebugGL.java:11724)
   at javax.media.opengl.DebugGL.glEnd(DebugGL.java:1816)
   at com.mugenguild.vMugen.graphics.OglDisplay.display(OglDisplay.java:244)
   at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78)
   at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:281)
   at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194)
   at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:258)
   at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
   at javax.media.opengl.GLCanvas.paint(GLCanvas.java:142)
   at sun.awt.RepaintArea.paintComponent(Unknown Source)
   at sun.awt.RepaintArea.paint(Unknown Source)
   at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
javax.media.opengl.GLException: glGetError() returned the following error codes after a call to glEnd(): GL_INVALID_OPERATION
   at javax.media.opengl.DebugGL.checkGLGetError(DebugGL.java:11724)
   at javax.media.opengl.DebugGL.glEnd(DebugGL.java:1816)
   at com.mugenguild.vMugen.graphics.OglDisplay.display(OglDisplay.java:266)
   at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78)
   at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:281)
   at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194)
   at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:298)
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)


wtf?! I've been shooting trouble for like, 5 hours now, and I can't seem to find any error. the only difference left, is that the texture is bound during the display routine instead of the init routine. but that can't be it... nuh?

...anyone?
7  Discussions / Miscellaneous Topics / Re: project stats on: 2006-02-20 21:50:14
doctorj is not 1.5-syntax compatible, and dies after some "unexpected identifier: <" errors Sad
8  Discussions / Miscellaneous Topics / project stats on: 2006-02-20 21:30:01
hey Smiley

does any of you know of any program that calculates some statistics of a java project?

like, count of words, count of words in comments, most referenced field, most instantiated class, stuff like that... no runtime information, just plain sourcecode statistics...

searching google for words like "text statistics" or "java project statistics" doesn't work, the words are use in other contexts too often Tongue
9  Game Development / Performance Tuning / Re: which collection to use? on: 2006-02-03 17:17:40
when did I ever say I didn't profile it?? I even posted that I know what my bottleneck is in my very last post. >_<
10  Game Development / Performance Tuning / Re: which collection to use? on: 2006-02-03 00:25:08
I never said this was my bottleneck, it's just that there are about 30000 values stored in hashmaps out of which about ~1000 need to be called per tick (1/60 second) or more, so I thought there might be a better way than boxing. It's not critical at all, but why not optimize it Smiley

My bottleneck is - surprise, surprise - java2d Wink
11  Game Development / Performance Tuning / Re: calling methods using reflection on: 2006-01-30 15:33:54
may be. oh well, works fine & fast now Wink
12  Game Development / Performance Tuning / Re: which collection to use? on: 2006-01-30 15:16:18
I know, I just told Jeff why I asked for this in the first place. >_<
13  Game Development / Performance Tuning / Re: which collection to use? on: 2006-01-30 14:35:51
I know, but still using a direct int->object association is faster (saves one boxing and two hash calls per get, and I need tons of gets) than using a boxed int, that's why I asked if there was any specific implementation for that.
14  Game Development / Performance Tuning / Re: calling methods using reflection on: 2006-01-30 03:38:18
funny, it's now indeed a good bit faster when cached. I could have sworn it wasn't earlier Huh
15  Game Development / Performance Tuning / Re: which collection to use? on: 2006-01-30 02:49:50
Yeash, but I couldn't find an interface for which there was any implementation for int->object association, that's why I asked in the first place Tongue
16  Discussions / Miscellaneous Topics / Re: if(i < j < k) ... on: 2006-01-29 11:28:32
huh? why? && and & are different operators used for compleyely different purposes...
17  Discussions / Miscellaneous Topics / Re: if(i < j < k) ... on: 2006-01-29 10:29:33
also, that would be slower than i < j && j < k, since if i < j evaluates to false, the whole expression can't be true anymore and it stops operating (try 0 && i++, it won't increment). you lose that edge with your idea Tongue
18  Game Development / Performance Tuning / Re: which collection to use? on: 2006-01-29 08:34:43
As I said in my first post, I can't use arraylist or the like because the indices aren't incremental. anyways, thanks for the javolution link, I didn't know about that before and it seems pretty nifty Cheesy

that whole page seems to be an advertisement for those libs, though. any experiences? o_O
19  Game Development / Performance Tuning / Re: calling methods using reflection on: 2006-01-29 08:27:58
if I cache the methods in a HashMap<String, Method>, it's 40% slower than using getMethod, so sticking with getMethod is definitely the better solution.

but, during my tests, this line
                    getClass().getMethod("__" + input.sval, new Class[] { HashMap.class }).invoke(this, new Object[] { data } );
several times actually performed better than this line, even if only by a small margin (10%)
                    ((AbstractInstance) caller).__out(data);

huh, wacky.
20  Game Development / Performance Tuning / Re: which collection to use? on: 2006-01-15 03:46:22
http://trove4j.sourceforge.net/

updated in 2005, while the pcj's last update was 2003 (prior to java 1.5).

thank you very much for your help Smiley
21  Game Development / Performance Tuning / which collection to use? on: 2006-01-14 11:00:14
hey there Smiley

The game I'm working on heavily depends on non-incremental numbers associated with objects (for many different purposes), and I can't find a good type of collection for this. ArrayList, Vector and LinkedList all depend on incremental indices, all other collections associate Objects with Objects. Right now I'm using HashMap<Integer, Object>, but I guess that's far from being the optimal solution.

Is there any int -> Object collection implementation which I simply overlooked? If that's not the case, is HashMap<Integer, Object> a good enough solution or should I write my own collection for this purpose?
22  Java Game APIs & Engines / JOGL Development / Re: crashes :( on: 2005-12-25 03:47:32
yay, it doesn't crash anymore Cheesy

is this common knowledge I just missed?? I mean, this invalidates all jogl tutorials etc and I didn't find any note about this, not even in the release notes... might want to fix that to avoid more questions Sad
23  Java Game APIs & Engines / JOGL Development / Re: crashes :( on: 2005-12-24 16:31:47
it's 64x64 Sad
24  Java Game APIs & Engines / JOGL Development / crashes :( on: 2005-12-24 08:00:03
hey guys Smiley

I'm having some problems with random crashes, and hope someone here can help me out

My gameloop is not handled by an animator, autoswapbuffer mode is 0, and each tick (after processing game logic), drawable.display() is called which calls display(), which calls the draw callbacks (and loads textures etc). after stuff is rendered, the game loop sleeps until end of tick (1/60 second) and swaps the buffer.

the loading routine for the texture is this:

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  
48  
49  
50  
51  
52  
53  
    private void makeTexture(GL gl) {

        // binds this texture, id is generated earlier
        bind(gl);
       
        int srcPixelFormat;
        if (bi.getColorModel().hasAlpha())
            srcPixelFormat = GL.GL_RGBA;
        else
            srcPixelFormat = GL.GL_RGB;

        // convert that image into a byte buffer of texture data
        ByteBuffer textureBuffer = convertImageData(bi, texWidth, texHeight);

        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP);
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP);
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);

        // produce a texture from the byte buffer
        gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, texWidth, texHeight, 0, srcPixelFormat, GL.GL_UNSIGNED_BYTE, textureBuffer);

    }

    private static ByteBuffer convertImageData(BufferedImage bi, int texWidth, int texHeight) {
        ByteBuffer imageBuffer = null;
        WritableRaster raster;
        BufferedImage texImage;

        // we need an ogl-compatible raster
        if (bi.getColorModel().hasAlpha()) {
            raster = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, texWidth, texHeight, 4, null);
            texImage = new BufferedImage(glAlphaColorModel, raster, false, null);
        } else {
            raster = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, texWidth, texHeight, 3, null);
            texImage = new BufferedImage(glColorModel, raster, false, null);
        }

        // copy the source image into the produced image
        Graphics2D g = (Graphics2D) texImage.getGraphics();
        g.setColor(new Color(0f, 0f, 0f, 0f));
        g.fillRect(0, 0, texWidth, texHeight);
        g.drawImage(bi, 0, 0, null);

        // build a byte buffer from the temporary image that be used by OpenGL to produce a texture.
        byte[] data = ((DataBufferByte) texImage.getRaster().getDataBuffer()).getData();

        imageBuffer = ByteBuffer.allocateDirect(data.length);
        imageBuffer.order(ByteOrder.nativeOrder());
        imageBuffer.put(data, 0, data.length);

        return imageBuffer;
    }


texwidth and texheight are the closest potence of 2 of the image's width/height, glColorModel/glAlphacolorModel are obviously the color models needed for the conversion, as you can see a good part of the code is taken from the known tutorials Tongue

the crashes occur at the glTexImage2D call, error is this:

Quote
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x697553d5, pid=1756, tid=1500
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_03-b07 mixed mode)
# Problematic frame:
# C  [nvoglnt.dll+0x2553d5]
#
# An error report file with more information is saved as hs_err_pid1756.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

ideas, anyone? Undecided
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 (15 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (185 views)
2014-04-01 02:16:10
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

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