Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (206)
games submitted by our members
Games in WIP (781)
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 2008 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: 869
Projects: 3
Exp: 16 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  
You cannot reply to this message, because it is very, very old.

Galdo (285 views)
2017-01-12 13:44:09

Archive (448 views)
2017-01-02 05:31:41

0AndrewShepherd0 (908 views)
2016-12-16 03:58:39

0AndrewShepherd0 (845 views)
2016-12-15 21:50:57

Lunch (980 views)
2016-12-06 16:01:40

ral0r2 (1211 views)
2016-11-23 16:08:26

ClaasJG (1312 views)
2016-11-10 17:36:32

CoffeeChemist (1334 views)
2016-11-05 00:46:53

jay4842 (1416 views)
2016-11-01 19:04:52

theagentd (1223 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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!