00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "config_wgldisplay.h"
00016 #include "wglGraphicsBuffer.h"
00017 #include "wglGraphicsPipe.h"
00018 #include "wglGraphicsStateGuardian.h"
00019 #include "wglGraphicsWindow.h"
00020 #include "graphicsPipeSelection.h"
00021 #include "dconfig.h"
00022 #include "pandaSystem.h"
00023
00024 Configure(config_wgldisplay);
00025 NotifyCategoryDef(wgldisplay, "display");
00026
00027 ConfigureFn(config_wgldisplay) {
00028 init_libwgldisplay();
00029 }
00030
00031 ConfigVariableInt gl_force_pixfmt
00032 ("gl-force-pixfmt", 0);
00033
00034 ConfigVariableBool gl_force_invalid
00035 ("gl-force-invalid", false,
00036 PRC_DESC("Set this true to force all GL windows to fail to open "
00037 "correctly (for debugging)."));
00038
00039 ConfigVariableBool gl_do_vidmemsize_check
00040 ("gl-do-vidmemsize-check", true,
00041 PRC_DESC("This is true to insist that low-memory cards open only 640x480 "
00042 "fullscreen windows, no matter what resolution of window was "
00043 "requested. It only affects fullscreen windows."));
00044
00045 ConfigVariableBool gl_support_fbo
00046 ("gl-support-fbo", true,
00047 PRC_DESC("Configure this false if your GL's implementation of "
00048 "EXT_framebuffer_object is broken. The system might still be "
00049 "able to create buffers using pbuffers or the like."));
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 void
00061 init_libwgldisplay() {
00062 static bool initialized = false;
00063 if (initialized) {
00064 return;
00065 }
00066 initialized = true;
00067
00068 wglGraphicsBuffer::init_type();
00069 wglGraphicsPipe::init_type();
00070 wglGraphicsStateGuardian::init_type();
00071 wglGraphicsWindow::init_type();
00072
00073 GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
00074 selection->add_pipe_type(wglGraphicsPipe::get_class_type(),
00075 wglGraphicsPipe::pipe_constructor);
00076
00077 PandaSystem *ps = PandaSystem::get_global_ptr();
00078 ps->set_system_tag("OpenGL", "window_system", "WGL");
00079 }