From: Nigel P. <ni...@in...> - 2002-04-30 01:14:27
|
Trying to implement the new "class monitor_desc" stuff, I am a little confused about how to store a monitor's modes. Christian previously proposed: > Here's a draft: > > - struct video_mode remains as it is now > - the global VideoModes vector is removed > - struct monitor_desc gets transformed into an abstract base class: > > class monitor_desc { > public: ... > // Get current video mode > const video_mode ¤t_mode(void) const {return = *current_mode;} ... > // List of supported video modes > vector<video_mode> modes; ... > } video_*.cpp for AmigaOS, MacOSX and Unix used to find out the modes supported by the main monitor, and then store each of those using add_mode(). There is now a list of modes per monitor, but the only way to set this list up is at class construction time. I think it would be easier if the base class had an method to add modes for that particular instance of the monitor. That way, we just need a loop that iterates monitors, creates new *_monitor_desc object for each monitor, and then adds the modes supported by that monitor to the object's list. So, any chance of something like: // Add mode to list of supported modes void monitor_desc::add_mode (uint32 width, uint32 height, uint32 resolution_id, uint32 bytes_per_row, video_depth depth) { video_mode mode; mode.x =3D width; mode.y =3D height; mode.resolution_id =3D resolution_id; mode.bytes_per_row =3D bytes_per_row; mode.depth =3D depth; modes.push_back(mode); } -- |Nigel Pearson, ni...@in... |=93Now the world has gone to = bed,| |Telstra iDevelopments, Sydney Australia| Darkness won=92t engulf my = head,| | Office: 9206 3468 Fax: 9212 6329 | I can see by infrared, = | | Mobile: 0408 664435 Home: 9792 6998 | How I hate the night.=94 = -Marvin| |