Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  
  Headless Rendering  (Read 1562 times)
0 Members and 1 Guest are viewing this topic.
Offline ShannonSmith
« Posted 2010-08-27 22:19:41 »

I posted this question on the lwjgl forum but due to the server meltdown I thought I would ask it over here:

1  
2  
3  
4  
5  
         Pbuffer pbuffer = new Pbuffer(800,600,new PixelFormat(),null,null);
         pbuffer.makeCurrent();
         GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
         ByteBuffer bytes = ByteBuffer.allocateDirect(800*600*3);
         GL11.glReadPixels(0,0,800,600,GL11.GL_RGB,GL11.GL_UNSIGNED_BYTE,bytes);


Why does this code give me an OpenGL 1282 (invalid opperation) error?
This is on Ubuntu Linux using the latest NVidia drivers.
Offline deepthought
« Reply #1 - Posted 2010-11-16 13:15:04 »

i don't know all that much, but maybe you need to put some parameters into that new PixelFormat.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #2 - Posted 2010-11-16 13:46:26 »

headless rendering? if I remember correctly it isn't supported by lwjgl, could be wrong though.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mike

JGO Wizard


Medals: 76
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #3 - Posted 2010-11-16 13:50:21 »

Initial post is almost 3 months old guys Smiley

He solved the issue and posted it on the LWJGL forum:
http://lwjgl.org/forum/topics/possible-bug-in-cvs/3439/view.html

Quote
I finally managed to make the issue go away. After much trial and error the PixelFormat that is used to create the pBuffer seems to be the issue. The default constructor doesn't require depth or stencil buffers and for some reason this causes a Invalid Operation when trying to readPixels(). Changing to an 8,8,1 PixelFormat fixed the issue.

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
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.

BurntPizza (12 views)
2014-09-21 02:42:18

BurntPizza (11 views)
2014-09-21 01:30:30

moogie (13 views)
2014-09-21 00:26:15

UprightPath (23 views)
2014-09-20 20:14:06

BurntPizza (27 views)
2014-09-19 03:14:18

Dwinin (40 views)
2014-09-12 09:08:26

Norakomi (70 views)
2014-09-10 13:57:51

TehJavaDev (96 views)
2014-09-10 06:39:09

Tekkerue (49 views)
2014-09-09 02:24:56

mitcheeb (70 views)
2014-09-08 06:06:29
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!