- Code: Select all
#include "pandaFramework.h"
#include "pandaSystem.h"
#include "geoMipTerrain.h"
#include <iostream>
PandaFramework framework;
int main(int argc, char *argv[]) {
//open a new window framework
framework.open_framework(argc, argv);
//set the window title to My Panda3D Window
framework.set_window_title("terrain tester");
//open the window
WindowFramework *window = framework.open_window();
//here is room for your own code
GeoMipTerrain *terr= new GeoMipTerrain("");
std::cerr<<"loading ";
terr->set_heightfield((string)"part_0.png");
std::cerr<<"done \n";
NodePath terrRoot = terr->get_root();
std::cerr<<"1\n";
terr->generate();
std::cerr<<"2\n";
terrRoot.reparent_to( window->get_render() );
std::cerr<<"3\n";
terrRoot.set_scale( 5,5,5);
std::cerr<<"4\n";
terrRoot.set_pos( 0,0,-10);
std::cerr<<"5\n";
//do the main loop, equal to run() in python
framework.main_loop();
//close the window framework
framework.close_framework();
return (0);
}
when I compile will g++ on fedora17/linux and run it I get the following output:
- Code: Select all
Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
:display:glxdisplay(warning): No suitable FBConfig contexts available; using XVisual only.
depth_bits=24 color_bits=24 alpha_bits=8 stencil_bits=8 back_buffers=1 force_hardware=1
loading done
1
base: dtool/src/dtoolbase/typeHandle.cxx:99: void TypeHandle::dec_memory_usage(TypeHandle::MemoryClass, int): Assertion `rnode->_memory_usage[memory_class] >= 0' failed.
I've tried moving the get_root after the generate. That does not change the output at all. If the geoMip code is replaced with the tutorials model loader everything works as expected.
Any help would be appreciated.
