mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Add display info.
This commit is contained in:
parent
9b6d67c32f
commit
ba432d161a
@ -32,7 +32,9 @@
|
|||||||
parasiteBuffer.I parasiteBuffer.h \
|
parasiteBuffer.I parasiteBuffer.h \
|
||||||
windowProperties.I windowProperties.h \
|
windowProperties.I windowProperties.h \
|
||||||
renderBuffer.h \
|
renderBuffer.h \
|
||||||
stencilRenderStates.h
|
stencilRenderStates.h \
|
||||||
|
displaySearchParameters.h \
|
||||||
|
displayInformation.h
|
||||||
|
|
||||||
#define INCLUDED_SOURCES \
|
#define INCLUDED_SOURCES \
|
||||||
standardMunger.cxx \
|
standardMunger.cxx \
|
||||||
@ -52,7 +54,9 @@
|
|||||||
parasiteBuffer.cxx \
|
parasiteBuffer.cxx \
|
||||||
windowProperties.cxx \
|
windowProperties.cxx \
|
||||||
lru.cxx \
|
lru.cxx \
|
||||||
stencilRenderStates.cxx
|
stencilRenderStates.cxx \
|
||||||
|
displaySearchParameters.cxx \
|
||||||
|
displayInformation.cxx
|
||||||
|
|
||||||
#define INSTALL_HEADERS \
|
#define INSTALL_HEADERS \
|
||||||
standardMunger.I standardMunger.h \
|
standardMunger.I standardMunger.h \
|
||||||
@ -75,7 +79,9 @@
|
|||||||
parasiteBuffer.I parasiteBuffer.h \
|
parasiteBuffer.I parasiteBuffer.h \
|
||||||
windowProperties.I windowProperties.h \
|
windowProperties.I windowProperties.h \
|
||||||
renderBuffer.h \
|
renderBuffer.h \
|
||||||
stencilRenderStates.h
|
stencilRenderStates.h \
|
||||||
|
displaySearchParameters.h \
|
||||||
|
displayInformation.h
|
||||||
|
|
||||||
#define IGATESCAN all
|
#define IGATESCAN all
|
||||||
|
|
||||||
|
@ -10,3 +10,5 @@
|
|||||||
#include "parasiteBuffer.cxx"
|
#include "parasiteBuffer.cxx"
|
||||||
#include "lru.cxx"
|
#include "lru.cxx"
|
||||||
#include "stencilRenderStates.cxx"
|
#include "stencilRenderStates.cxx"
|
||||||
|
#include "displaySearchParameters.cxx"
|
||||||
|
#include "displayInformation.cxx"
|
||||||
|
@ -43,6 +43,8 @@ GraphicsPipe() :
|
|||||||
|
|
||||||
_display_width = 0;
|
_display_width = 0;
|
||||||
_display_height = 0;
|
_display_height = 0;
|
||||||
|
|
||||||
|
_display_information = new DisplayInformation ( );
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -73,6 +75,7 @@ operator = (const GraphicsPipe &) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
GraphicsPipe::
|
GraphicsPipe::
|
||||||
~GraphicsPipe() {
|
~GraphicsPipe() {
|
||||||
|
delete _display_information;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -138,3 +141,12 @@ make_output(const string &name,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: GraphicsPipe::get_display_information
|
||||||
|
// Access: Published
|
||||||
|
// Description: Gets the pipe's DisplayInformation.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
DisplayInformation * GraphicsPipe::
|
||||||
|
get_display_information() {
|
||||||
|
return _display_information;
|
||||||
|
}
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "typedReferenceCount.h"
|
#include "typedReferenceCount.h"
|
||||||
#include "pointerTo.h"
|
#include "pointerTo.h"
|
||||||
#include "pmutex.h"
|
#include "pmutex.h"
|
||||||
|
#include "displayInformation.h"
|
||||||
|
|
||||||
class GraphicsOutput;
|
class GraphicsOutput;
|
||||||
class GraphicsWindow;
|
class GraphicsWindow;
|
||||||
@ -96,6 +97,8 @@ PUBLISHED:
|
|||||||
INLINE int get_display_width() const;
|
INLINE int get_display_width() const;
|
||||||
INLINE int get_display_height() const;
|
INLINE int get_display_height() const;
|
||||||
|
|
||||||
|
DisplayInformation *get_display_information();
|
||||||
|
|
||||||
virtual string get_interface_name() const=0;
|
virtual string get_interface_name() const=0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -127,6 +130,8 @@ protected:
|
|||||||
int _display_width;
|
int _display_width;
|
||||||
int _display_height;
|
int _display_height;
|
||||||
PT(GraphicsDevice) _device;
|
PT(GraphicsDevice) _device;
|
||||||
|
|
||||||
|
DisplayInformation *_display_information;
|
||||||
|
|
||||||
static const int strip_properties[];
|
static const int strip_properties[];
|
||||||
|
|
||||||
|
@ -3,19 +3,23 @@
|
|||||||
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
|
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
|
||||||
dtoolutil:c dtoolbase:c dtool:m
|
dtoolutil:c dtoolbase:c dtool:m
|
||||||
#define WIN_SYS_LIBS Imm32.lib
|
#define WIN_SYS_LIBS Imm32.lib
|
||||||
|
|
||||||
#define BUILDING_DLL BUILDING_PANDAWIN
|
#define BUILDING_DLL BUILDING_PANDAWIN
|
||||||
|
|
||||||
|
#define USE_PACKAGES dx
|
||||||
|
|
||||||
#begin lib_target
|
#begin lib_target
|
||||||
#define TARGET windisplay
|
#define TARGET windisplay
|
||||||
#define LOCAL_LIBS \
|
#define LOCAL_LIBS \
|
||||||
display putil
|
display putil
|
||||||
|
|
||||||
#define COMBINED_SOURCES $[TARGET]_composite1.cxx
|
#define COMBINED_SOURCES $[TARGET]_composite1.cxx winDetectDx9.cxx winDetectDx8.cxx winDetectDx7.cxx
|
||||||
|
|
||||||
#define SOURCES \
|
#define SOURCES \
|
||||||
config_windisplay.h \
|
config_windisplay.h \
|
||||||
winGraphicsPipe.I winGraphicsPipe.h \
|
winGraphicsPipe.I winGraphicsPipe.h \
|
||||||
winGraphicsWindow.I winGraphicsWindow.h
|
winGraphicsWindow.I winGraphicsWindow.h \
|
||||||
|
winDetectDx.h
|
||||||
|
|
||||||
#define INSTALL_HEADERS \
|
#define INSTALL_HEADERS \
|
||||||
config_windisplay.h \
|
config_windisplay.h \
|
||||||
@ -27,7 +31,6 @@
|
|||||||
config_windisplay.cxx winGraphicsPipe.cxx \
|
config_windisplay.cxx winGraphicsPipe.cxx \
|
||||||
winGraphicsWindow.cxx
|
winGraphicsWindow.cxx
|
||||||
|
|
||||||
|
|
||||||
#define WIN_SYS_LIBS Imm32.lib winmm.lib kernel32.lib oldnames.lib user32.lib gdi32.lib
|
#define WIN_SYS_LIBS Imm32.lib winmm.lib kernel32.lib oldnames.lib user32.lib gdi32.lib
|
||||||
|
|
||||||
#end lib_target
|
#end lib_target
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "winGraphicsPipe.h"
|
#include "winGraphicsPipe.h"
|
||||||
#include "config_windisplay.h"
|
#include "config_windisplay.h"
|
||||||
|
#include "displaySearchParameters.h"
|
||||||
|
|
||||||
TypeHandle WinGraphicsPipe::_type_handle;
|
TypeHandle WinGraphicsPipe::_type_handle;
|
||||||
|
|
||||||
@ -39,6 +40,28 @@ WinGraphicsPipe() {
|
|||||||
_pfnTrackMouseEvent =
|
_pfnTrackMouseEvent =
|
||||||
(PFN_TRACKMOUSEEVENT)GetProcAddress(_hUser32, "TrackMouseEvent");
|
(PFN_TRACKMOUSEEVENT)GetProcAddress(_hUser32, "TrackMouseEvent");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dx7_display_information (DisplaySearchParameters &display_search_parameters, DisplayInformation *display_information);
|
||||||
|
int dx8_display_information (DisplaySearchParameters &display_search_parameters, DisplayInformation *display_information);
|
||||||
|
int dx9_display_information (DisplaySearchParameters &display_search_parameters, DisplayInformation *display_information);
|
||||||
|
|
||||||
|
DisplaySearchParameters display_search_parameters;
|
||||||
|
|
||||||
|
// DX7
|
||||||
|
if (dx7_display_information (display_search_parameters, _display_information)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// try DX9 first
|
||||||
|
if (dx9_display_information (display_search_parameters, _display_information)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// DX9 failed, try DX8
|
||||||
|
if (dx8_display_information (display_search_parameters, _display_information)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user