Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (767)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (854)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  No auxiliary buffers?  (Read 2597 times)
0 Members and 1 Guest are viewing this topic.
Offline Spasi
« Posted 2003-01-21 20:13:12 »


I used gl.getIntegerv(GL.AUX_BUFFERS, p) in LWJGL and I got 0 as the number of available auxiliary buffers and I was wondering why. Is it a lack of my graphics card (GeForce 2 MX)? Or is it a problem with the opengl/nvidia driver? Or maybe LWJGL just doesn't create any? Is it possible to specifically ask for one at opengl/window initialization?

Here's what I need an auxiliary buffer for:

I have a 3d scene at the background and a UI (with windows, menus, buttons etc.) at the foreground. Because I don't want to redraw the UI every frame, as it updates infrequently, I would like to be able to draw it on an auxiliary buffer, every time a change occurs and it needs to be repainted. Then, every frame, I would just have to copy the contents of the auxiliary buffer on top of the scene, saving me a lot of rerendering. As it is now, just copying a whole buffer is much faster than repainting the whole interface (I tested it using the back buffer).

So it would go like this:
- Render 3d scene
- Copy aux -> back
- Render cursor
- Swap buffers

What do you guys think? Is there another approach you could suggest?

Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #1 - Posted 2003-01-21 20:30:45 »

Unfortunatly the Geforce 2 doesn't support any aux buffers Sad In fact I'm not aware of any consumer-level hardware that does.

Try looking into render-to-texture or p-buffers instead. But this also looks like being more than a tad tricky to achieve in a platform independant and speedy way last time I looked..  Angry

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Spasi
« Reply #2 - Posted 2003-01-21 21:39:38 »

Yeah, that's what I thought. I'm just wondering why such a feature hasn't been implemented yet by anyone. Memory consumption maybe? Anyway, thanks for your answer.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Spasi
« Reply #3 - Posted 2003-01-22 00:03:29 »

OK, I decided to have a try with p-buffers, so naturally I downloaded some nice tutorials that describe how to use them. This is what I found:

There are five major steps required to create a pbuffer:
1. Get a valid device context
2. Find a pbuffer-capable pixel format
3. Create a pbuffer of the chosen pixel format
4. Create a device context for the pbuffer
5. Create an OpenGL rendering context associated with the pbuffer

Step 1.
Getting a valid device context amounts to getting an ID or handle to the device that’s going to be doing all the rendering work. In this case (and most cases in general), the device we want to get is the graphics accelerator device. If a window (capable of displaying OpenGL graphics on the screen) has just been created, this process is straightforward:

HDC hdc = wglGetCurrentDC();

This call gives you the handle to the graphics accelerator device.

First, there is no wglGetCurrentDC() in LWJGL, but there is a wglGetCurrentReadDCARB(), which I suppose returns the device context. The problem is that uppon calling this method I get this:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x0

NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions.

Current Java thread:
       at org.lwjgl.opengl.GL.wglGetCurrentReadDCARB(Native Method)

Is this a LWJGL problem, or am I doing something wrong? In the BaseGL class there is an int field called handle. And it's protected. So I created a subclass of GL with a method:

public int getHandle() {
  return handle;

This way I can retrieve it. Is this the handle to the current rendering context? Cas, some help?

Offline princec

« JGO Spiffy Duke »

Medals: 1053
Projects: 3
Exp: 20 years

Eh? Who? What? ... Me?

« Reply #4 - Posted 2003-01-22 08:37:36 »

argh, hold your horses etc.
First a quick point - even if the GF2 did have aux buffers we don't ask for any when we init the LWJGL window (not really a game requirement). If you want to fiddle around with such things perhaps you want to check out the dll source code and tweak display init for now.

As for p-buffers - whoops, you've found a bug I think, because it seems like we've forgotten to initialise handle with a value... (otherwise I don't know anything about p-buffers much but in all honesty I'd avoid them like the plague and use ARB_render_texture instead which is far easier to use and understand.

Cas Smiley

Offline Spasi
« Reply #5 - Posted 2003-01-22 11:44:00 »

I don't like messing with p-buffers either, but render-to-texture requires the use of p-buffers. When is the next version of LWJGL coming out...?  Wink
Pages: [1]
  ignore  |  Print  

EgonOlsen (1260 views)
2018-06-10 19:43:48

EgonOlsen (1129 views)
2018-06-10 19:43:44

EgonOlsen (864 views)
2018-06-10 19:43:20

DesertCoockie (1273 views)
2018-05-13 18:23:11

nelsongames (1105 views)
2018-04-24 18:15:36

nelsongames (1336 views)
2018-04-24 18:14:32

ivj94 (2076 views)
2018-03-24 14:47:39

ivj94 (1229 views)
2018-03-24 14:46:31

ivj94 (2171 views)
2018-03-24 14:43:53

Solater (795 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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!