Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
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: Font rendering on: 2006-05-10 20:03:27
Will the recommended text label rendering procedure change once 2D/3D mixing is available in Mustang?

My needs center around rendering an axis labeled with numeric values, but other typical uses would be to render objects and then put a descriptive label next to each, or to show two views and label one "View 1" and the other "View 2".  I currently use the GLUT bitmap fonts, but there are limited styles and sizes.  People with high-res screens have to squint, but the text looks a lot better than it does with the GLUT stroke font.

Ideally, the program would choose the font size to fit the screen area available at a given resolution.  The user could then choose different fonts or change the text size in the same way that is possible with Ctrl++ and Ctrl+- in Firefox.  I would like to be able center or right-justify the text, and get the metrics of the rendered string.

Would this type of feature be possible using the current procedure?  If so, has anyone written a class to automate it?
2  Java Game APIs & Engines / JOGL Development / Re: Deploy with Java Web Start on: 2006-04-22 01:55:48
So, if I want to get something working in the next couple of weeks, would you recommend using Web Start to launch an installer application that copied files from the jar to the hard drive?  I'm sure a lot of people do this, but I wasn't sure if it was considered the correct way.
3  Java Game APIs & Engines / JOGL Development / Re: Deploy with Java Web Start on: 2006-04-22 00:18:07
One thing I noticed was that the latest NetBeans IDE is installed using an exe file.  I'd expect that particular project to embrace Web Start as much as possible, so the fact that they use an exe makes me wonder if there are still some limitations of Web Start in regards to certain applications.  Perhaps they just haven't had time to convert their existing installer to Web Start.

Web Start documentation spends a lot of time on the case of launching from a web page which, at the very least, proves it is well named.  Many JOGL and Java  games probably fit in that category.  They don't really address how you would use it to install an office application or publishing package.  I had a hard time finding a "best practices", patterns, strategies, or complete examples for installing that type of application.  Like I said, I don't know if that's because it's more rare and unexplored thus far, or if it's a fundamental limitation.
4  Java Game APIs & Engines / JOGL Development / Re: Deploy with Java Web Start on: 2006-04-21 01:21:34
Thanks for your help.  I'm pretty ignorant about Web Start and just started using it because this forum recommended it.  The documentation I read never addressed this topic and I didn't know about the other forums, but I'll check them out now.
5  Java Game APIs & Engines / JOGL Development / Re: Deploy with Java Web Start on: 2006-04-20 22:19:35
I've just now gotten my application to install and run using Java Web Start.  Previously, I was unzipping a zip file and putting a shortcut to a batch file on the desktop.  I could drag files and drop them on the icon to open them with my application, because the file name would be passed as an argument by the batch file. 

When I drop a file on the shortcut placed by Web Start, it fails to open because the file doesn't get passed to my main method as an argument.  Is this a limitation of Web Start, or is there a way around it?  I would also like to be able to double click on a file and open it with my app, which works using the batch file, but not the Web Start shortcut.

Finally, some users have scripts that call utility classes that are located in my jar files.  When Web Start caches my jar, will it always be in the same accessible location?

Thanks.
6  Java Game APIs & Engines / JOGL Development / Re: Experiences of migrating from JOGL 1.1.1 to JSR231 on: 2006-03-21 22:24:07
OK, so my opinion has been registered.  I can live with the extra comma and zero.

Quote
Some calls which used to allow a direct array argument now needs IntBuffer.wrap (array)  (e.g., glDrawPixels)

One variant of glDrawPixels takes Buffer pixels and the other takes long pixels_buffer_offset .  What is the difference, and how would you convert JOGL code to the latter?

Thanks.
7  Java Game APIs & Engines / JOGL Development / Re: Experiences of migrating from JOGL 1.1.1 to JSR231 on: 2006-03-21 00:56:22
Quote
All GL calls where you pass in an array you need to add an extra offset parameter - 0 when refactoring (aside: this is particularly tedious and inelegant - do the extra method bindings really matter?)

I just started the big switch to JSR 231, and I agree.  I appreciate all the work that has gone into this effort but, at the risk of seeming picky, I may as well speak up now, rather than not at all.  After reading the original slides a couple of years ago, where it seemed the best of the best would be pulled from previous bindings, I expected a more elegent solution.  When a new user decides to try OpenGL and Java together, they'll punch in a simple example from the Red Book, and they'll hit this.  After all that has been overcome to create these bindings, there isn't room for overloaded bindings that look like classic OpenGL?
8  Java Game APIs & Engines / JOGL Development / Re: glVertex2d EXCEPTION_ACCESS_VIOLATION on: 2005-04-15 21:15:32
-Xint and -server gave the same error.

I'll try to simplify the problem.  Thanks
9  Java Game APIs & Engines / JOGL Development / Re: glVertex2d EXCEPTION_ACCESS_VIOLATION on: 2005-04-15 20:09:19
I'm calling the drawing code from the display method.  I don't see any errors.  It just writes

Quote

CANVAS GL IS: net.java.games.jogl.DebugGL
CANVAS GLU IS: net.java.games.jogl.impl.GLUImpl


I went back and tried running it with a previous version of my app using GL4Java and Java 1.4.2 and I got the same error.  I guess that indicates a problem with the video driver or OS?
10  Java Game APIs & Engines / JOGL Development / Re: glVertex2d EXCEPTION_ACCESS_VIOLATION on: 2005-04-15 19:19:05
> What are you debugging with?

JBuilder 2005.

The problem also happens running the program from a batch file.

Does it sound like a bug in the driver?
11  Java Game APIs & Engines / JOGL Development / glVertex2d EXCEPTION_ACCESS_VIOLATION on: 2005-04-15 18:16:03
When running a certain class in my app I get the following error.  It happens at a call to glVertex2d() for a GL_QUAD_STRIP a few hundred iterations through a loop.  The arguments are array values which look OK when I check them in the debugger just before the fateful call.  Other classes I have which call glVertex2d seem to work fine.

Any ideas?

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  
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x695ce571, pid=1692, tid=3008
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode)
# Problematic frame:
# C  [nvoglnt.dll+0xce571]
#

...

Stack: [0x65ff0000,0x66030000),  sp=0x6602f26c,  free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [nvoglnt.dll+0xce571]
C  [nvoglnt.dll+0xb92f8]
j  net.java.games.jogl.impl.windows.WindowsGLImpl.glVertex2d(DD)V+0

...

---------------  S Y S T E M  ---------------

OS: Windows XP Build 2600 Service Pack 2

CPU:total 4 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht

Memory: 4k page, physical 2097151k(2097151k free), swap 4194303k(4194303k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_02-b09) for windows-x86, built on Mar  4 2005 01:53:53 by "java_re" with MS VC++ 6.0


NVidia Quadro FX 3400
Driver 7.1.8.4, 2/24/2005

JOGL 1.1b10
12  Java Game APIs & Engines / JOGL Development / Re: glVertexPointer and Buffer on: 2005-02-03 20:30:11
I converted it as you said with the exception of keeping the buffer around from frame to frame.  I allocate a new one with every redraw and I quickly crash with an OutOfMemoryError.

I can change the code to reuse the buffer as long as the underlying data don't change, but if the user adds points to the underlying array, I will have to allocate a new, larger direct buffer.  How do I deallocate the old one to avoid a memory leak?
13  Java Game APIs & Engines / JOGL Development / Re: glVertexPointer and Buffer on: 2005-01-31 23:33:23
Well, I went on vacation for the holidays, then fought with upgrading to a new computer, and did some other work.  I finally got back to my "convert from GL4Java to JOGL" project last week.  I put in over a day switching the syntax from allocating arrays to allocating buffers.  Then I was finally able to compile the app without errors and I found that the optional Buffer array() method doesn't work with direct buffers and I apparently have to use get() and put().  Then I logged in to the JOGL forums and saw the previous post, which stated the same.  Great.

There are so many array accesses in my code.  Things like array1 = array2[j] + array3[k].  There is no way I'm changing all that to get() and put() on buffers.  It's time prohibitive, not to mention the significant chance of introducing errors.  My app isn't just an OpenGL app.  It does a lot of other things, which users relay on.  I can't drop everything and completely restructure my design, rewrite thousands of lines of code, and risk introducing bugs just to take advantage of slightly faster buffers.  I couldn't justify it for 10x faster buffers.

For compatability, I suggest offering a lower performance alternative that uses arrays with glVertexPointer the way GL4Java did.  For some people, such as myself, there isn't time for big rewrites like this.  The only time-effective alternative I see now is converting to for-loops with glVertex.  I may be able to convert the most performance critical code to Buffer and glVertexPointer as I get time later.
14  Java Game APIs & Engines / JOGL Development / Re: glVertexPointer and Buffer on: 2004-12-16 17:47:45
Quote

Is there a reason not to allocate the buffer/array inside the DataSeries constructor...

Then again, you might need to access the specific array out side the class...


I do frequently access the array from outside the DataSeries object.  A quick count shows 26 classes that modify the array on their own.  The pattern I was using was for a file-parser class to allocate an array, read vertex data into the array, and then create a new DataSeries from the array.  Later, the user might add a vertex so an editor class would retrieve the array, allocate a new array that is one vertex larger, and copy the existing vertices.  The editor class would then call setArray(newArray) on the DataSeries to replace the old array.

I have a number of editor classes for different types of objects.  Some only allow modifications.  Others allow adding or deleting.  The DataSeries array is interleaved and holds any number of dimensions.  For example, it could hold a 2D Time-Value plot, a 3D X-Y-Z surface, a 5D Time-X-Y-Z-Scalar animation of an object that varies in location and color.

The DataSeries getArray() method can be changed easily from "return array" to "return buffer.array()".  But the DataSeries.setArray(float[]) method will have to be changed to setBuffer(Buffer), which means the parsers and editor classes will have to create a buffer for the DataSeries instead of an array.

I do handle some edit operations within the DataSeries class, but I try to keep them general like shift, multiply, resample, etc.  Some operations, such as frequency filtering, are more complex and should be in a separate class that operates on the DataSeries.

I've begun recoding them.  I'm about half way right now.
15  Java Game APIs & Engines / JOGL Development / glVertexPointer and Buffer on: 2004-12-14 22:41:59
I am wondering about the strategy of using direct buffers with glVertexPointer.  With GL4Java, I had code like

1  
gl.glVertexPointer(2, gl.GL_FLOAT, 0, series.getArray());


where "series" was an instance of my DataSeries class, which basically wraps a float array and provides getArray() and setArray() along with other functionality.

JOGL uses a Buffer with glVertexPointer but, apparently, it requires it to be direct.  Therefore, FloatBuffer.wrap(array) does not work, as it creates a non-direct buffer.  I found that the following code works as a functional replacement

1  
2  
3  
4  
5  
6  
float[] array = series.getArray();
ByteBuffer bBuf = ByteBuffer.allocateDirect(4 * array.length);
bBuf.order(ByteOrder.nativeOrder());
FloatBuffer fBuf = bBuf.asFloatBuffer();
fBuf.put(array);
gl.glVertexPointer(2, gl.GL_FLOAT, 0, fBuf);


The problem is that the array can be any size.  On occasion, the application is memory bound because of it.  I'm not sure I like being forced to take an existing array, allocate new space for it, and copy it in, when space is already tight.

The only alternative I see is to rewrite the DataSeries class to be based around a Buffer instead of an array.  Any code that allocates an array and creates a DataSeries from it would need to be modified to allocate a Buffer instead.  This would be a considerable effort.  Is there any alternative to this?

Is there a reason that JOGL can't work with a non-direct buffer?  According to the Java documentation for ByteBuffer, "In general it is best to allocate direct buffers only when they yield a measureable gain in program performance."  Would giving the option of a non-direct wrapped array be a big drain on performance or be harder to implement?
16  Java Game APIs & Engines / JOGL Development / Re: JSR 231: Java OpenGL Bindings Status on: 2004-12-13 15:53:11
Certain portions of the web site change with the times, but I was referring to the top level page at

http://jogl.dev.java.net/

which says "Welcome to the JOGL API Project!" and appears to be JOGL central.  But I don't think it ever changes.  I believe the front pages at opengl.org or mozilla.org are updated daily, so it gives you a reason to check back periodically.  Daily updates aren't necessary, but I think the front page for an evolving project should be as recent as any content within the site.  It would be nice if it said something like "The latest version is ___.  Download it _here_."  That just makes you feel like there's a little bit of life at the site and you're not wasting time reading a snapshot in time from a year ago.

I don't think the page reflects the current status of the project.  For instance, the getting started section seems to focus on building the library rather than using it, which gives the impression that its still in a construction phase and, perhaps, not fully ready for use beyond contributors and early adopters.  And the FAQ link at the top doesn't lead anywhere.  I eventually found my way to the downloads and the forum, but some potential users that heard about JSR 231 and want to check the status may get the wrong impression and give up.
17  Java Game APIs & Engines / JOGL Development / Re: GLException: Unable to select GLCapabilities on: 2004-12-11 00:45:06
Since the result returned didn't match, I wondered if there coud be a problem with the display driver.  I upgraded it from version 05050335 to 05050618, rebooted and, sure enough, my window popped up.  iresult is now 8235 and it passes the test.  My new output is:

Choosing window system's recommended choice of 0

GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 32, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0 ]


Sorry I didn't try that sooner.  Thanks for the help.
18  Java Game APIs & Engines / JOGL Development / Re: GLException: Unable to select GLCapabilities on: 2004-12-10 23:55:15
I changed both of the tests to the form you suggested, but formats 0-59 now fail the test

1  
2  
3  
4  
case GL.WGL_PIXEL_TYPE_ARB:
    if (iresults[i] != GL.WGL_TYPE_RGBA_ARB)
        return null;
    break;


because iresults[7] == 8236

According to wglext.h,

GL.WGL_TYPE_RGBA_ARB == 0x202B == 8235
WGL_TYPE_COLORINDEX_ARB == 0x202C == 8236

Formats 60-83 now fail the test

1  
2  
3  
4  
case GL.WGL_DRAW_TO_WINDOW_ARB:
    if (iresults[i] == GL.GL_FALSE)
        return null;
    break;


because iresults[0] == 0
19  Java Game APIs & Engines / JOGL Development / Re: JSR 231: Java OpenGL Bindings Status on: 2004-12-10 15:54:27
I've been wondering the same thing.  Ever since the Fahrenheit project, I've been rather skeptical to hear that "SGI has reached an agreement with Big Corp. X to bring graphics to the people and cause great rejoicing."  Hopefully, it is only delayed, but when the web page gets that out of date it does cause it to look a little dead.  Actually, the JOGL web page isn't updated very much, either.  All the activity seems to be on this forum.
20  Java Game APIs & Engines / JOGL Development / Re: GLException: Unable to select GLCapabilities on: 2004-12-10 15:35:47
I'm stepping through WindowsGLContext in the debugger.  I assume that's what you meant for me to do.  pfd2GLCapabilities never gets called.  In iattributes2GLCapabilities, for formats 0-59, it returns null for the code

       case GL.WGL_SUPPORT_OPENGL_ARB:
         if (iresults != GL.GL_TRUE)
           return null;
         break;

because
iresults[7] == 8236

For formats 60-83, it returns null for the code

       case GL.WGL_DRAW_TO_WINDOW_ARB:
         if (iresults != GL.GL_TRUE)
           return null;
         break;

because
iresults[0] == 0

Let me know what other information I can provide.
Thanks for helping.
21  Java Game APIs & Engines / JOGL Development / Re: GLException: Unable to select GLCapabilities on: 2004-12-09 23:36:23
OK, I finally got it to compile and run (after struggling with signed Jar security exceptions and getting the paths to the source and jars straight in JBuilder).  Here is the output:

Available 0: null
Available 1: null
Available 2: null
Available 3: null
Available 4: null
Available 5: null
Available 6: null
Available 7: null
Available 8: null
Available 9: null
Available 10: null
Available 11: null
Available 12: null
Available 13: null
Available 14: null
Available 15: null
Available 16: null
Available 17: null
Available 18: null
Available 19: null
Available 20: null
Available 21: null
Available 22: null
Available 23: null
Available 24: null
Available 25: null
Available 26: null
Available 27: null
Available 28: null
Available 29: null
Available 30: null
Available 31: null
Available 32: null
Available 33: null
Available 34: null
Available 35: null
Available 36: null
Available 37: null
Available 38: null
Available 39: null
Available 40: null
Available 41: null
Available 42: null
Available 43: null
Available 44: null
Available 45: null
Available 46: null
Available 47: null
Available 48: null
Available 49: null
Available 50: null
Available 51: null
Available 52: null
Available 53: null
Available 54: null
Available 55: null
Available 56: null
Available 57: null
Available 58: null
Available 59: null
Available 60: null
Available 61: null
Available 62: null
Available 63: null
Available 64: null
Available 65: null
Available 66: null
Available 67: null
Available 68: null
Available 69: null
Available 70: null
Available 71: null
Available 72: null
Available 73: null
Available 74: null
Available 75: null
Available 76: null
Available 77: null
Available 78: null
Available 79: null
Available 80: null
Available 81: null
Available 82: null
Available 83: null
Scores: [ -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999, -9999999 ]
22  Java Game APIs & Engines / JOGL Development / GLException: Unable to select GLCapabilities on: 2004-12-09 17:44:29
I am converting my code to JOGL from GL4Java.  I am getting an error at runtime for the following test code.  Do I need to create a custom glCap to pass in?  I'm running Win2K with a 3Dlabs Wildcat II 5110 at 1600x1200, 32 bit.  JDK 1.5.0,  JOGL 1.1b07 - November 19


 GLCanvas canvas =
     GLDrawableFactory.getFactory().createGLCanvas(
     new GLCapabilities());

 Frame testFrame = new Frame("TestFrame");
 testFrame.setSize( 512, 384 );
 testFrame.add( canvas );
 testFrame.setVisible(true);


Exception in thread "main" net.java.games.jogl.GLException: Unable to select one of the provided GLCapabilities
     at net.java.games.jogl.DefaultGLCapabilitiesChooser.chooseCapabilities(DefaultGLCapabilitiesChooser.java:214)
     at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:471)
     at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:211)
     at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:135)
     at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
     at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:250)
     at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:112)
     at java.awt.Component.setBounds(Component.java:1847)
     at java.awt.BorderLayout.layoutContainer(BorderLayout.java:809)
     at java.awt.Container.layout(Container.java:1401)
     at java.awt.Container.doLayout(Container.java:1390)
     at java.awt.Container.validateTree(Container.java:1473)
     at java.awt.Container.validate(Container.java:1448)
     at java.awt.Window.show(Window.java:507)
     at java.awt.Component.show(Component.java:1300)
     at java.awt.Component.setVisible(Component.java:1253)
23  Java Game APIs & Engines / JOGL Development / Re: How to pronounce JOGL on: 2004-12-09 15:02:26
I never realized how language diverse this forum is.  Unfortunately, none of this helps me know how to say JOGL in Californian.  Maybe I'll just say it like Keanu Reeves and follow it up with "Dude!"
24  Java Game APIs & Engines / JOGL Development / How to pronounce JOGL on: 2004-12-08 21:47:57
What is the proper way to pronounce JOGL?

Joe-Gull ?

Jaw-Gull ?

Juggle ?

Jay-Oh-Jee-El ?

Some other way?

:-/
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 (22 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (189 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!