2d heads-up display

in my game i created some heads-up windows using CEGUI
but the problem is that they are sometimes hidden,
sometimes visible.
I allready set depth_test and depth_write to false
but it is not working.

window->get_render_2d().attach_new_node(callback_node); //Add the CallbackNode of CEGUI to 2D render
//window->get_render_2d().set_depth_offset(0); //Testing
//window->get_render_2d().set_bin("fixed",1); //Testing

I am now trying to create a extra display region
but there my problem is that i do not konw how to convert the camera into nodepath.

	DisplayRegion* region2d = window->get_graphics_output()->make_display_region();

	Camera myCamera2d = Camera("myCam2d");
	NodePath myCamera2dNode = ???;
	OrthographicLens* lens = new OrthographicLens();
	lens->set_film_size(2, 2);
	lens->set_near_far(-1000, 1000);

	NodePath myRender2d = NodePath("myRender2d");

please help me.

Could your CEGUI disappearing problem be the same as this one: [PyCEGUI / CallbackNode render bug with shader generator) ?

Converting a Node to a NodePath is as simple as calling the NodePath constructor:

PT(Camera) myCamera2d = new Camera("myCam2d")
NodePath myCamera2dNode(myCamera2d);

Note that a Camera object should always be created as a PT(Camera), never as a concrete object, because it inherits (indirectly) from ReferenceCount.


ok thanks
i did not try to use a pointer
anyway, it does not help

i have the same problem as in the thread
but they still have no solution

OK, perhaps we have to wait until a solution is found. Sometimes many eyes can help find a solution faster–would you like to help research the problem, following the suggestions given in that other thread?


you wrote
i just need to add glActiveTexture(GL_TEXTURE0)
but which include did i need?
or is it in c++ in a class or namespace?

#include <GL/gl.h>

OpenGL is C, so it’s not in a namespace or class.

hmm does not work
my code:

#include <pandaFramework.h>
#include <pandaSystem.h>
#include <GL/gl.h>

#include <CEGUI.h>
#include <CEGUISystem.h>
#include <RendererModules/OpenGL/CEGUIOpenGLRenderer.h>
#include <CEGUIDefaultResourceProvider.h>

#include <callbackData.h>
#include <callbackNode.h>
#include <callbackObject.h>
#include <orthographicLens.h>

#include <mouseWatcher.h>
#include <buttonThrower.h>
#include <event.h>
#include <eventReceiver.h>

class GUIUpdateCallback : public CallbackObject {
	void do_callback(CallbackData *cbdata){
		glActiveTexture(GL_TEXTURE0); //not found
		CEGUI::System *guiSystem = CEGUI::System::getSingletonPtr();
		if (guiSystem){
		if (cbdata){

What do you mean “not found”? Do you mean the compiler complains there is no such symbol defined? glActiveTexture() is new as of OpenGL 1.3, so if your system’s OpenGL headers are older than that, it won’t be defined. (Of course, “new” is relative, as OpenGL 1.3 was released in 2001, but there are indeed some systems out there with OpenGL headers older than that. It’s possible that the default Microsoft-provided OpenGL headers are only 1.1, as Microsoft sometimes appears to go out of their way to make OpenGL development difficult.)

There are various ways of working around this, including (a) installing a later version of the OpenGL headers, (b) including glext.h, or © using the OpenGL extension system to call it as an extension function.

But none of these are exactly trivial, and I gather that you are fairly new to OpenGL programming, and C/C++ programming in general. So perhaps the simplest advice will be to pick up the latest version of Panda3D from the cvs source tree, which solves this problem for you.