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   
Pages: [1]
  ignore  |  Print  
  No auxiliary buffers?  (Read 1279 times)
0 Members and 1 Guest are viewing this topic.
Offline Spasi
« Posted 2003-01-21 21:13:12 »

Hi,

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
- Render UI -IF NECESSARY-
- Copy aux -> back
- Render cursor
- Swap buffers

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

Spasi
Offline Orangy Tang

JGO Kernel


Medals: 51
Projects: 11


Monkey for a head


« Reply #1 - Posted 2003-01-21 21: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

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Spasi
« Reply #2 - Posted 2003-01-21 22: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.

Spasi
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Spasi
« Reply #3 - Posted 2003-01-22 01: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
Function=[Unknown.]
Library=(N/A)

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?

Spasi
Offline princec

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2003-01-22 09: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 12: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.

 

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

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

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

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

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

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

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

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

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

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