There are still a few small issues I need to resolve (scrolling, vertical text, a
little error handling) and I haven't tested the ez328 driver with it yet. I'll fix
these things up ASAP. But, the bulk of the rotation functionality works.
The 90 degree anticlockwise rotation is triggered by a new video mode flag,
PG_VID_ROTATE90. To facilitate changing this at runtime, I had to rearrange video
driver initialization some, but I ended up with a new client call, pgSetVideoMode():
----8<---- (from client_c.h)
/* Change video mode at runtime
* xres and yres specify a new resolution, or 0 to not change it
* bpp specifies a new bit depth, 0 to not change it
* flagmode is a PG_FM_* constant specifying how to combine the specified
* flags with the existing flags. Flags contol extra driver features such
* as fullscreen mode and screen rotation.
*/
void pgSetVideoMode(unsigned short xres,unsigned short yres,
unsigned short bpp,unsigned short flagmode,
unsigned long flags);
----8<----
Everything here works (well, mostly)
I had to implemenent resolution switching at runtime because rotating also involves
changing the screen size, so it works under applicable drivers. Depth switching sort
of works. The driver switches depth, but the code to convert bitmaps to new bit depths
is not written yet.
'flags' contains the PG_VID_ROTATE90 flag (among others) and flagmode lets you specify
how to combine the specified flags with the server's existing flags. Here is a small
example program to toggle the screen orientation and leave everything else alone:
----8<----
#include <picogui.h>
int main(int argc,char **argv) {
pgInit(argc,argv);
pgSetVideoMode(0,0,0,PG_FM_TOGGLE,PG_VID_ROTATE90);
pgUpdate();
return 0;
}
----8<----
Also note that rotation is now a compile time option (under the Video Base Libraries
section) and if it is not compiled in, the rotate90 flag is currently ignored.
--
Only wimps use tape backup: _real_ men just upload
their important stuff on ftp, and let the rest of the
world mirror it ;)
-- Linus Torvalds
_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/pgui-devel