BetaArchive Logo
Navigation Home Screenshots Image Uploader Server Info FTP Servers Wiki Forum RSS Feed Rules Please Donate
UP: 25d, 6h, 9m | CPU: 57% | MEM: 5396MB of 12227MB used
{The community for beta collectors}

Forum rules


Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPost subject: OSBA OS Update        Posted: Wed Nov 08, 2006 6:00 am 
Reply with quote
Donator
Offline

Joined
Sat Aug 19, 2006 1:25 am

Posts
590

Location
Israel
Over the last few weeks I've been working on oDisplay (OSBA OS' native windowing environment).

To show (off) what oDisplay can already do, here's a sample application that draws the image given as a parameter and displays a "Hello, World!" message:
Code:
#include "oDisplay.h"

int main(int *argc,char *argv[])
{
   unsigned long *image;
   unsigned int width,height;
   odWindow *wnd,*wnd2;

// check that a file was specified
   if ( argc < (int *)2 )
      fatalError(-1,"main","no file specified.");
// initiate oDisplay
   odInit();

// load the specified image
   image = odLoadImage(argv[1],&width,&height);
// if we can't load it, exit with an error message
   if ( ! image )
      fatalError(-1,"main","can't load image.");

// create a window at location 100,100 with the image's width and height,
// set its parent window to the root window, make it shown by default
// (first 1) and managed by default (second 1), and make it without an
// event handler (the NULL)
   wnd = odCreateWindow(100,100,width,height,odGetRootWindow(),1,1,NULL);
// set its transparency to 64 (25%)
   odSetWindowAlpha(wnd,0,0,width,height,64);
// color the root window with a light blue color
   odFill(odGetRootWindow(),0,0,screenWidth,screenHeight,0xFFCCCCFF);
// draw the image
   odDrawBlock(wnd,0,0,width,height,image);

// get the text size
   odGetTextSize("Hello, World!","arial",12,&width,&height);
// create the second window
   wnd2 = odCreateWindow(350,500,width+40,height+10,odGetRootWindow(),1,1,NULL);
// color it white
   odFill(wnd2,0,0,width+40,height+10,0xFFFFFFFF);
// draw the text on the second window, at location 20,5, using font arial size 12, color black and 0xFF opacity
   odDrawTextToWindow(wnd2,20,5,"Hello, World!","arial",12,0xFF000000);

// wait ten seconds
   sleep(10);
// destroy both windows
   odDestroyWindow(wnd);
   odDestroyWindow(wnd2);
// terminate oDisplay and exit with a success code
   odTerminate();
   return 0;
}
this is what this program looks like when run with the Google logo as a parameter:
Image

As you can see, oDisplay already has windowing, text, transparency and image-loading support, and I'm currently working on loadable widget support.

Notice the coding simplicity compared to other low level windowing environments (X11, Win32, ...).


Top  Profile
 PostPost subject:        Posted: Wed Nov 08, 2006 7:11 am 
Reply with quote
Donator
User avatar
Offline

Joined
Tue Aug 22, 2006 3:30 pm

Posts
407

Location
Essex, UK

Favourite OS
Gentoo
wow, cool :D looks great, when it gets good enuf ill start using it :D

_________________
The better candies are in the cage


Top  Profile  WWW  ICQ  YIM
 PostPost subject:        Posted: Wed Nov 08, 2006 8:19 am 
Reply with quote
FTP Access
Offline

Joined
Sun Nov 05, 2006 3:41 am

Posts
114

Location
NY

Favourite OS
Arch Linux
I used OSBA OS in vmware, and it's actually a pretty good OS, I might install it on my spare PC soon when it gets better :D


Top  Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 




Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

All views expressed in these forums are those of the author and do not necessarily represent the views of the BetaArchive site owner.

Powered by phpBB® Forum Software © phpBB Group

Copyright © 2006-2018

 

Sitemap | XML | RSS