Jump to content


Photo

Sdl Gui Library


  • Please log in to reply
13 replies to this topic

#1 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 594 posts
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 10 March 2010 - 10:35 PM

I am currently working on my Odamex for Xbox port. One of the critical tasks is to create a launcher interface so that someone can start the single-player with their desired wads or browse the Odamex server list and join an online game. In an effort to speed up that development and improve the end result I am interested in porting an SDL GUI library. Currently I am working on a port of Guichan. I already have the libraries compiled for Xbox against the SDLx libs and I have a test project compiling against my resulting guichan lib. Of course it isn't going to be that easy and when the draw is attempted there is an exception so I am working on debugging it to find the hang up.

Before I get too deep into this I was wondering if anyone has already ported one of the SDL GUI libraries to Xbox. I could not find anything on the subject so I suspect that it either hasn't been done yet or anyone who has done it hasn't made their work publicly available. I thought it would be worth asking. Should I get guichan working (which I don't anticipate being unable to achieve it) I will make the work available. Thanks for any info.

#2 obcd

obcd

    X-S Hacker

  • Moderator
  • PipPipPipPipPipPip
  • 2,737 posts
  • Xbox Version:v1.0
  • 360 version:none

Posted 11 March 2010 - 10:37 AM

Xport made the sources available of all the emulators he created.
I assume you might find usefull stuff in it to create your user interface for the Odamex xbox port.

Most of his emulators are also ports of the emulators for the windows or linux platform.
It's the material I would use as reference.

regards.


#3 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 594 posts
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 17 March 2010 - 02:39 AM

Thanks for the recommendation. I do regularly reference xports code, along with XBMC and other open Xbox projects, to see good examples of Xbox API in use. Unfortunately I cannot reference xport code for the UI I am producing because xport uses D3D. I need something portable as this UI will not be limited to Xbox. That is why I was interested in an SDL GUI library.

Luckily I have not had too much trouble porting guichan...

IPB Image

#4 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 594 posts
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 17 March 2010 - 03:49 AM

Here is one of the guichan samples that I compiled on Xbox (with a tad bit of my own text added):

IPB Image



#5 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 17 March 2010 - 01:24 PM

QUOTE(Hyper_Eye @ Mar 17 2010, 10:49 AM) View Post

All the work being done for this effort is committed into our repository though and as I work I continue to make commits. It can all be found in the odameXbox branch of the odamex svn repository.

Is the guichan port commited to the same branch?

#6 Pulsemasta

Pulsemasta

    X-S Expert

  • Members
  • PipPipPip
  • 725 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 17 March 2010 - 02:44 PM

Hey, I was wondering, will you be releasing your source for the Xbox port of guichan? I think it would be a great contribution to the scene and I personally would like to mess around with that and compare your code to the PC code to try and learn a few things. I have studied the Xport interface a lot trying to implement it in other applications.

#7 hcf

hcf

    X-S Senior Member

  • Members
  • PipPip
  • 200 posts

Posted 17 March 2010 - 03:57 PM

Congratulations for your work!! It is very nice to see new things in the Xbox scene!! Please, go on with your project!! smile.gif

#8 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 594 posts
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 21 March 2010 - 12:56 AM

QUOTE(ldotsfan @ Mar 17 2010, 07:24 AM) View Post

Is the guichan port commited to the same branch?


The guichan port will not be committed into the Odamex svn repository as it is an external dependency (assuming that I decide to go with guichan for the interface.)

QUOTE(Pulsemasta @ Mar 17 2010, 08:44 AM) View Post

Hey, I was wondering, will you be releasing your source for the Xbox port of guichan? I think it would be a great contribution to the scene and I personally would like to mess around with that and compare your code to the PC code to try and learn a few things. I have studied the Xport interface a lot trying to implement it in other applications.


Guichan was portable out-of-the-box. The SDL port did all the work. I ditched any code that wasn't relevant to the SDL backend. The issue with getting it to run was due to dynamic casts in guichan which required that RTTI (RunTime Type Identification) be enabled. Without that exceptions were thrown whenever a dynamic cast was made. Once that was done everything worked great. I am trying to decide whether or not I want to add support for the Xbox controller into the library itself or just put that in the interface code. If I were to make a change like that I would see where committing the code to a repository would be necessary. If not I think it would be good enough to simply put together a package with the libs built and headers for developers to use and a source package as well that could be obtained from the usual places.

#9 flux2k

flux2k

    X-S Senior Member

  • Members
  • PipPip
  • 175 posts

Posted 31 March 2010 - 11:40 PM

Do those form elements still work when you change the font size? It looks like it would be pretty hard to read on a TV.

#10 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 594 posts
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 03 April 2010 - 10:33 PM

I did not have a hard time reading the fonts on my LCD television at all. Keep in mind that this library is for SDL with the intention that it be used in video games so it is geared towards that purpose. But the answer is that the fonts are provided by an ImageFont so you can make them whatever you want. There are some available on the guichan site: http://guichan.sourc...Font_collection

You can also make your own pretty easily as you can tell at that link. So the answer is yes... you can use custom fonts that will look good on any television.

I was actually preparing a couple subversion repositories for the Xbox libraries I am working on. I already got the SDLx repository up but as I was about to get the guichan Xbox repository up I started feeling intense abdominal pain. I had to go to the emergency room and I was passing a gallstone through a bile duct and it was the most painful thing I have experienced in my entire life. The next day I had my gallbladder removed and now I am recovering. So I was in the process of making this stuff available for you guys when I had a medical emergency so I will get back to this after my recovery or at least when I can stop taking the pain medicine long enough to think through getting it done. I had a very similar experience last year but the problem turned out to be appendicitis and they took out my appendix. Losing an organ a year doesn't seem very sustainable. Appendicitis is pretty painful, btw, but passing a gallstone is about 100x worse.

#11 obcd

obcd

    X-S Hacker

  • Moderator
  • PipPipPipPipPipPip
  • 2,737 posts
  • Xbox Version:v1.0
  • 360 version:none

Posted 05 April 2010 - 12:08 PM

Sorry to hear you have health problems.

Hope you get well fast.

You only realise the importance of health if you don't have it anymore.

all the best.

#12 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 594 posts
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 05 April 2010 - 11:07 PM

Thanks. I am feeling a lot better.

I will be sharing that subversion info very soon.

#13 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 594 posts
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 08 April 2010 - 10:22 AM

For those of you interested in access to these libraries please review the following thread: http://forums.xbox-s...howtopic=710866

#14 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 594 posts
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 18 April 2010 - 11:56 PM

I have added another SDL-based GUI library to the list of ports I am working on. This library is called Agar. It is a full-featured GUI toolkit unlike Guichan which is very minimal. With this library you can create very simple to very complex GUI-based applications very efficiently. The API is powerful but applications can be created quickly with a minimal amount of code when necessary as the library can be allowed to handle the majority of the GUI work for you. Alternatively you can control things at an intricate level to produce highly customized applications. Agar is a mature library and there are widgets built in for most common needs. Also, the work required to create a custom widget is minimal allowing inheritance from any widgets already present. The applications you build with Agar are also highly portable as Agar can be used with Windows, Linux, OS X, PS2, GC/Wii, and many others (most anything that supports SDL or OpenGL.)

Agar can be themed and it is skinnable. It could be used to make many of the launcher interfaces we are accustomed to with a much faster production time. It can be used to create a launcher, a complete GUI-based application, or it can be used within your game for your games interface needs.

The library depends on the libSDLx, SDL_Image, and Freetype libraries all of which can be found in the SDLx svn repository on Huntsvegas. The file browser widget can load files from the D:\ path (the running games directory) but it cannot yet navigate around the file system. The controller is also not yet supported so a keyboard and mouse is needed. Those two things are the top priorities for completing the port. As it is you could receive the joystick input with SDL and make the warp mouse calls yourself to move the cursor around the screen. Agar can use hardware rendering through OpenGL but the Xbox port uses the sdlfb driver since OpenGL is unavailable.

The library should be easy to compile once the library dependencies are properly configured in your VC++ Project Directories setting (Tools->Options->Projects->VC++ Directories). Once you have the library compiled you will find in the demos directory a project that contains 23 total demo applications. All have been modified for the Xbox. With your Xbox on at your XDK dash you should be able to build the project and all the demo applications will be on your dash to try out. A couple of them will require you to copy a file or two into the demos directory that the xbe's are in on your Xbox in order to work correctly. Building the demos does not require configuring the VC++ Project Directories Setting for the Agar libs as the projects use relative paths for that but when you make your own application you should use the VC++ Project Directories setting.

Using the SDLx library available on my repository you can run your Agar application at HDTV resolutions. In the demos you will find that I used 600x450 as the resolution much of the time. The reason I did this is because Agar will use the closest resolution, draw the GUI at the resolution requested, and center it. So using 600x450 gets me a 640x480 picture with the GUI placed nicely in the televisions viewable area. That way you can compensate for overscan without sacrificing image quality as you do when using the SDLx resize function. This is important because using the resize function may not noticeably impact graphics but it has a huge negative impact on fonts. It can make fonts completely illegible. Compensating for overscan the way I do in these Agar demos means that the fonts are perfectly clear and there is no negative impact to the image quality. If you search the demos for the word "HDTV" you will find a couple spots I wrote in where you can swap a line of code to try the demo out in 720p. You will notice that for 720p I use the resolution 1230x685 for a good overscan compensation.

Unfortunately I did not realize that a new major release was made before the weekend. They have moved to 1.4. I worked on what I had downloaded in the middle of the week which was 1.3.5. So that is what is in the repository. I plan to move to the new 1.4 release as soon as possible.

For more info

View the Agar website here: http://libagar.org/
View the Huntsvegas SVN Repos thread here: http://forums.xbox-s...howtopic=710866

Any comments, ideas, questions, and especially patches are welcome!

Now I will post some screenshots for your viewing pleasure. These are a few of the demos available in svn.

Here is the Xbox on the XDK dash showing part of the demos list:

IPB Image

This is the "Loader" demo running at 480p with the Xbox visible:

IPB Image

Here is the "Loader" demo running in 720p with a couple images loaded. DISCLAIMER: I did not pick these pictures. They were included with the demo:

IPB Image

Here is the "Themes" demo at 480p:

IPB Image

The "Themes" demo at 720p:

IPB Image

A screen grab of the "Plot" demo at 480p:

IPB Image

Here are some 720p screen grabs. You can see the empty overscan area in these:

http://www.huntsvega...loader-720p.jpg
http://www.huntsvega...themes-720p.jpg

Edited by Hyper_Eye, 19 April 2010 - 12:02 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users