Building Panda3D with OpenGL ES using Cygwin and MSVC9. Log

Should we really have a separate wegldisplay? I was thinking of having egldisplay use the Windows interfaces in the case of Windows, and X11 in the case of Unix.

It doesn’t matter to me. Once wegldisplay is working it should be easy to merge egl and wegl.

Note: eglDisplay should compile in windows (or at least it did). I found it easier to distance myself from that though to limit breakage points.

Another update. I merge the wegl code into egldisplay. It should still compile and link properly in Linux. If not there are probably a few small chagnes that need making.

Unfortunately pview still can’t find a graphics pipe. Not sure what I am doing wrong.

UPDATE: I don’t have many libs, like libp3framework.

Awesome, great job! I’d be happy to incorporate your changes and make sure it still works on Linux.

Do you have “load-display pandagles2” in Config.prc? Is there any warning saying that it couldn’t be loaded?

Here is my prc file

load-display pandagles
load-display pandagles2
load-display egldisplay
load-display pandagl
notify-level-panagles3 spam

Here is the console output of pview

colinn@colinn-PC /cygdrive/c/panda3d-1.7.0
$ pview
Known pipe types:
(all display modules loaded.)
No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.

colinn@colinn-PC /cygdrive/c/panda3d-1.7.0
$ which pview

I can’t create a hello world app since I don’t have libp3framework. So I must be missing something.

Hmm… two things could be wrong.

Firstly, try adding a “plugin-path” line to Config.prc pointing to the location of the directory that contains the pandagles dll.

Secondly, make sure the Config.prc file is loaded at all, by setting the PRC_DIR environment variable to the directory containing it.

PS. I also notice there’s “panagles3” in your Config.prc file. Shouldn’t that be “pandagles2”?

(old post deleted)

I get a window now. My config.prc was in etc and I had used cygwin style paths for PRC_DIR instead of windows style paths.

Unfortunately it crashes, but at least its something.

Here is the log

Known pipe types:
(all display modules loaded.)
:display:windisplay: OS version: 
:display:windisplay:   Service Pack 2
:display:windisplay: max Mhz 2800000000, current Mhz 2800000000 
:display:egldisplay(error): eglChooseConfig failed: EGL_SUCCESS
:display:egldisplay(error): Failed to create window surface.
:display:gsg:gles2gsg(warning): Unable to query GL_VENDOR
:display: loading display module: libpandagles2.dll

The error is thrown by this code:

  int attrib_list[] = {
#ifdef OPENGLES_1
#ifdef OPENGLES_2

  int num_configs = 0;
  EGLConfig configs[32];
  if (!eglChooseConfig(_egl_display, attrib_list, configs, 32, &num_configs) || num_configs <= 0) {
    egldisplay_cat.error() << "eglChooseConfig failed: "
      << get_egl_error_string(eglGetError()) << "\n";

Because eglGetError() apparently returns EGL_SUCCESS, I can assume that it just returns no available configs.

Are you sure that EGL is supposed to work? The code asks for a GLES2 renderable, does your device really support GLES2? Otherwise you should try the pandagles renderer.

It should work. I have some sample running from another project.

I’ve added file/line prints to the error cats.

Do you know what could be different between the Panda3D code and the sample code?

It is hard to say. My sample is all in one file so it’s easier to follow. I’m still workout out the use of Pipes, Buffers, and Windows


Been away for a while. I had to shift priority back to some other work.

Anyways. I’ve got the display set up. I had to change the config options for eglChooseConfig to work. I’ve since encountered two problems. The first was that Panda couldn’t find an appropriate set of FrameBuffer properties. It could only get hardware_accel=1, not RGB, ALPHA, DEPTH, and BACK BUFFER…which seemed strange. To just hack past this is I commented out the code which adds those missing properties.

Next I get this

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

// stack

 	>	libpandagles_d.dll!GLESGraphicsStateGuardian::prepare_vertex_buffer(GeomVertexArrayData * data=0x02272a44)  Line 3569	C++
 	libpanda_d.dll!PreparedGraphicsObjects::prepare_vertex_buffer_now(GeomVertexArrayData * data=0x02272a44, GraphicsStateGuardianBase * gsg=0x0306e424)  Line 955 + 0x16 bytes	C++
 	libpanda_d.dll!GeomVertexArrayData::prepare_now(PreparedGraphicsObjects * prepared_objects=0x0306ea1c, GraphicsStateGuardianBase * gsg=0x0306e424)  Line 286 + 0x10 bytes	C++
 	libpandagles_d.dll!GLESGraphicsStateGuardian::setup_array_data(const unsigned char * & client_pointer=0xcccccccc, const GeomVertexArrayDataHandle * array_reader=0x0227007c, bool force=false)  Line 3724 + 0x37 bytes	C++
 	libpandagles_d.dll!GLESGraphicsStateGuardian::update_standard_vertex_arrays(bool force=false)  Line 2642 + 0x15 bytes	C++
 	libpandagles_d.dll!GLESGraphicsStateGuardian::begin_draw_primitives(const GeomPipelineReader * geom_reader=0x0080f434, const GeomMunger * munger=0x02272514, const GeomVertexDataPipelineReader * data_reader=0x0080f408, bool force=false)  Line 2500 + 0xd bytes	C++
 	libpanda_d.dll!GeomPipelineReader::draw(GraphicsStateGuardianBase * gsg=0x0306e424, const GeomMunger * munger=0x02272514, const GeomVertexDataPipelineReader * data_reader=0x0080f408, bool force=false)  Line 1781 + 0x23 bytes	C++
 	libpanda_d.dll!Geom::draw(GraphicsStateGuardianBase * gsg=0x0306e424, const GeomMunger * munger=0x02272514, const GeomVertexData * vertex_data=0x02272928, bool force=false, Thread * current_thread=0x02fcd46c)  Line 1219 + 0x19 bytes	C++
 	libpanda_d.dll!CullableObject::draw_inline(GraphicsStateGuardianBase * gsg=0x0306e424, bool force=false, Thread * current_thread=0x02fcd46c)  Line 252	C++
 	libpanda_d.dll!CullableObject::draw(GraphicsStateGuardianBase * gsg=0x0306e424, bool force=false, Thread * current_thread=0x02fcd46c)  Line 144	C++
 	libpanda_d.dll!CullHandler::draw(CullableObject * object=0x022723d8, GraphicsStateGuardianBase * gsg=0x0306e424, bool force=false, Thread * current_thread=0x02fcd46c)  Line 27	C++
 	libpanda_d.dll!CullBinStateSorted::draw(bool force=false, Thread * current_thread=0x02fcd46c)  Line 90 + 0x19 bytes	C++
 	libpanda_d.dll!CullResult::draw(Thread * current_thread=0x02fcd46c)  Line 277 + 0x31 bytes	C++
 	libpanda_d.dll!GraphicsEngine::do_draw(CullResult * cull_result=0x030906ac, SceneSetup * scene_setup=0x03090dcc, GraphicsOutput * win=0x030685e4, DisplayRegion * dr=0x03088ee4, Thread * current_thread=0x02fcd46c)  Line 1895	C++
 	libpanda_d.dll!GraphicsEngine::draw_bins(GraphicsOutput * win=0x030685e4, DisplayRegion * dr=0x03088ee4, Thread * current_thread=0x02fcd46c)  Line 1535	C++
 	libpanda_d.dll!GraphicsEngine::draw_bins(const ov_set<PointerTo<GraphicsOutput>,IndirectLess<GraphicsOutput> > & wlist={...}, Thread * current_thread=0x02fcd46c)  Line 1490	C++
 	libpanda_d.dll!GraphicsEngine::WindowRenderer::do_frame(GraphicsEngine * engine=0x0306711c, Thread * current_thread=0x02fcd46c)  Line 2468	C++
 	libpanda_d.dll!GraphicsEngine::render_frame()  Line 738	C++
 	libframework_d.dll!PandaFramework::task_igloop(GenericAsyncTask * task=0x0226b868, void * data=0x0040d178)  Line 1567 + 0x15 bytes	C++
 	libpanda_d.dll!GenericAsyncTask::do_task()  Line 76 + 0x1b bytes	C++
 	libpanda_d.dll!AsyncTask::unlock_and_do_task()  Line 455 + 0xf bytes	C++
 	libpanda_d.dll!AsyncTaskChain::service_one_task(AsyncTaskChain::AsyncTaskChainThread * thread=0x00000000)  Line 770 + 0xf bytes	C++
 	libpanda_d.dll!AsyncTaskChain::do_poll()  Line 1306	C++
 	libpanda_d.dll!AsyncTaskManager::poll()  Line 547	C++
 	libframework_d.dll!PandaFramework::do_frame(Thread * current_thread=0x02fcd46c)  Line 832 + 0xe bytes	C++
 	libframework_d.dll!PandaFramework::main_loop()  Line 847 + 0x13 bytes	C++
 	pview.exe!main(int argc=1, char * * argv=0x03059650)  Line 370 + 0xd bytes	C++
 	pview.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes	C
 	pview.exe!mainCRTStartup()  Line 403	C
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	libdtool_d.dll!std::_Move_backward_opt<Filename *,Filename *,std::random_access_iterator_tag,std::_Undefined_move_tag>(Filename * _First=, Filename * _Last=, Filename * _Dest=, std::random_access_iterator_tag _First_dest_cat={...}, std::_Undefined_move_tag __formal={...}, std::_Undefined_move_tag __formal={...})  Line 2755 + 0xa bytes	C++

The line appears to be

if (GLCAT.is_debug() && CLP(debug_buffers)) {

This is compiled with OPTIMIZE=1

The following errors are reported

:display: loading display module: libpandagles_d.dll
Known pipe types:
(all display modules loaded.)
:display:windisplay: OS version: 
:display:windisplay:   Service Pack 2
:display:windisplay: max Mhz 2800000000, current Mhz 2800000000 
:display:gsg:glesgsg(warning): Multitexture advertised as supported by OpenGL runtime, but could not get pointers to extension functions.
:display:gsg:glesgsg(error): at 8321 of c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : GL error 1280

I was able to get rid of the GL enumeration warning by forcibly disabling cube map support.

So no ideas on the ESP crash posted above?