mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
add supports_fullscreen() etc. to graphicsPipe
This commit is contained in:
parent
fad8dc93f2
commit
99b5342b5b
@ -34,3 +34,47 @@ INLINE bool GraphicsPipe::
|
||||
is_valid() const {
|
||||
return _is_valid;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsPipe::supports_fullscreen
|
||||
// Access: Published
|
||||
// Description: Returns false if this pipe is known to not support
|
||||
// any creation of fullscreen windows. If this returns
|
||||
// false, any attempt to create a window with the
|
||||
// fullscreen property set will certainly fail.
|
||||
//
|
||||
// Returns true when the pipe will probably support
|
||||
// fullscreen windows. This is not, however, a
|
||||
// guarantee that an attempt to create a fullscreen
|
||||
// window will not fail.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool GraphicsPipe::
|
||||
supports_fullscreen() const {
|
||||
return _supports_fullscreen;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsPipe::get_display_width
|
||||
// Access: Public
|
||||
// Description: Returns the width of the entire display, if it is
|
||||
// known. This may return 0. This is not a guarantee
|
||||
// that windows (particularly fullscreen windows) may
|
||||
// not be created larger than this width, but it is
|
||||
// intended to provide a hint to the application.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int GraphicsPipe::
|
||||
get_display_width() const {
|
||||
return _display_width;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsPipe::get_display_height
|
||||
// Access: Public
|
||||
// Description: Returns the height of the entire display, if it is
|
||||
// known. This may return 0. See the caveats for
|
||||
// get_display_width().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int GraphicsPipe::
|
||||
get_display_height() const {
|
||||
return _display_height;
|
||||
}
|
||||
|
@ -32,6 +32,13 @@ GraphicsPipe() {
|
||||
// Initially, we assume the GraphicsPipe is valid. A derived class
|
||||
// should set this to false if it determines otherwise.
|
||||
_is_valid = true;
|
||||
|
||||
// Similarly, we initially assume the pipe will support fullscreen
|
||||
// windows. A derived class can choose to inform us otherwise.
|
||||
_supports_fullscreen = true;
|
||||
|
||||
_display_width = 0;
|
||||
_display_height = 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -60,6 +60,11 @@ PUBLISHED:
|
||||
PT(GraphicsWindow) get_window(int n) const;
|
||||
|
||||
INLINE bool is_valid() const;
|
||||
INLINE bool supports_fullscreen() const;
|
||||
|
||||
INLINE int get_display_width() const;
|
||||
INLINE int get_display_height() const;
|
||||
|
||||
virtual string get_interface_name() const=0;
|
||||
|
||||
public:
|
||||
@ -81,6 +86,9 @@ protected:
|
||||
Mutex _lock;
|
||||
|
||||
bool _is_valid;
|
||||
bool _supports_fullscreen;
|
||||
int _display_width;
|
||||
int _display_height;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
|
@ -48,23 +48,3 @@ INLINE Window glxGraphicsPipe::
|
||||
get_root() const {
|
||||
return _root;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: glxGraphicsPipe::get_display_width
|
||||
// Access: Public
|
||||
// Description: Returns the width of the entire display.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int glxGraphicsPipe::
|
||||
get_display_width() const {
|
||||
return _display_width;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: glxGraphicsPipe::get_display_height
|
||||
// Access: Public
|
||||
// Description: Returns the height of the entire display.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int glxGraphicsPipe::
|
||||
get_display_height() const {
|
||||
return _display_height;
|
||||
}
|
||||
|
@ -41,11 +41,10 @@ glxGraphicsPipe(const string &display) {
|
||||
}
|
||||
|
||||
_is_valid = false;
|
||||
_supports_fullscreen = false;
|
||||
_display = NULL;
|
||||
_screen = 0;
|
||||
_root = (Window)NULL;
|
||||
_display_width = 0;
|
||||
_display_height = 0;
|
||||
|
||||
_display = XOpenDisplay(display_spec.c_str());
|
||||
if (!_display) {
|
||||
@ -118,5 +117,6 @@ make_window() {
|
||||
if (!_is_valid) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return new glxGraphicsWindow(this);
|
||||
}
|
||||
|
@ -49,19 +49,14 @@ public:
|
||||
INLINE Display *get_display() const;
|
||||
INLINE int get_screen() const;
|
||||
INLINE Window get_root() const;
|
||||
INLINE int get_display_width() const;
|
||||
INLINE int get_display_height() const;
|
||||
|
||||
protected:
|
||||
virtual PT(GraphicsWindow) make_window();
|
||||
|
||||
private:
|
||||
bool _is_valid;
|
||||
Display *_display;
|
||||
int _screen;
|
||||
Window _root;
|
||||
int _display_width;
|
||||
int _display_height;
|
||||
|
||||
|
||||
public:
|
||||
|
@ -314,6 +314,11 @@ close_window() {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool glxGraphicsWindow::
|
||||
open_window() {
|
||||
if (_properties.get_fullscreen()) {
|
||||
// We don't support fullscreen windows.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!_properties.has_origin()) {
|
||||
_properties.set_origin(0, 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user