00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "pandabase.h"
00016
00017 #ifdef WIN32
00018
00019 #include "tinyWinGraphicsPipe.h"
00020 #include "config_tinydisplay.h"
00021 #include "config_windisplay.h"
00022 #include "tinyWinGraphicsWindow.h"
00023 #include "tinyGraphicsBuffer.h"
00024
00025 TypeHandle TinyWinGraphicsPipe::_type_handle;
00026
00027
00028
00029
00030
00031
00032 TinyWinGraphicsPipe::
00033 TinyWinGraphicsPipe() {
00034 }
00035
00036
00037
00038
00039
00040
00041 TinyWinGraphicsPipe::
00042 ~TinyWinGraphicsPipe() {
00043 }
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 string TinyWinGraphicsPipe::
00056 get_interface_name() const {
00057 return "TinyPanda";
00058 }
00059
00060
00061
00062
00063
00064
00065
00066
00067 PT(GraphicsPipe) TinyWinGraphicsPipe::
00068 pipe_constructor() {
00069 return new TinyWinGraphicsPipe;
00070 }
00071
00072
00073
00074
00075
00076
00077
00078 PT(GraphicsOutput) TinyWinGraphicsPipe::
00079 make_output(const string &name,
00080 const FrameBufferProperties &fb_prop,
00081 const WindowProperties &win_prop,
00082 int flags,
00083 GraphicsEngine *engine,
00084 GraphicsStateGuardian *gsg,
00085 GraphicsOutput *host,
00086 int retry,
00087 bool &precertify) {
00088
00089 if (!_is_valid) {
00090 return NULL;
00091 }
00092
00093 TinyGraphicsStateGuardian *tinygsg = 0;
00094 if (gsg != 0) {
00095 DCAST_INTO_R(tinygsg, gsg, NULL);
00096 }
00097
00098
00099
00100 if (retry == 0) {
00101 if (((flags&BF_require_parasite)!=0)||
00102 ((flags&BF_refuse_window)!=0)||
00103 ((flags&BF_resizeable)!=0)||
00104 ((flags&BF_size_track_host)!=0)||
00105 ((flags&BF_rtt_cumulative)!=0)||
00106 ((flags&BF_can_bind_color)!=0)||
00107 ((flags&BF_can_bind_every)!=0)) {
00108 return NULL;
00109 }
00110 if ((flags & BF_fb_props_optional)==0) {
00111 if ((fb_prop.get_aux_rgba() > 0)||
00112 (fb_prop.get_aux_hrgba() > 0)||
00113 (fb_prop.get_aux_float() > 0)) {
00114 return NULL;
00115 }
00116 }
00117 return new TinyWinGraphicsWindow(engine, this, name, fb_prop, win_prop,
00118 flags, gsg, host);
00119 }
00120
00121
00122 if (retry == 1) {
00123 if (((flags&BF_require_parasite)!=0)||
00124 ((flags&BF_require_window)!=0)) {
00125 return NULL;
00126 }
00127 return new TinyGraphicsBuffer(engine, this, name, fb_prop, win_prop,
00128 flags, gsg, host);
00129 }
00130
00131
00132 return NULL;
00133 }
00134
00135 #endif // WIN32