Welcome! Log In Create A New Profile

Advanced

libwiigui alternatives in C not C++

Posted by SteelSLasher 
libwiigui alternatives in C not C++
April 11, 2009 05:53PM
I was pretty excited when i found libwiigui only to be set back when i had found it was in c++, I have made a wrapper for C++ libs to run in C but its really difficult to implement so I didnt bother. I am now wondering if there are any other gui libs available that can use images as they are without having to convert them (like in GRRLIB).

I would try SDL but I cant find any docs for the libogc version which is a bit of a pain.
Re: libwiigui alternatives in C not C++
April 11, 2009 06:32PM
At the moment, no, there's nothing pre-made - although you can certainly make something from scratch. The ability to compile in PNG files like libwiigui does is determined by the makefile, you can take a look there for how to do that.

Shy of C++? FYI, You can keep the rest of your app in C, and just use C++ for the GUI, if you wish.
Re: libwiigui alternatives in C not C++
April 11, 2009 08:25PM
Quote
SteelSLasher
I am now wondering if there are any other gui libs available that can use images as they are without having to convert them (like in GRRLIB).

Not sure where you are coming from here, but I use GRRLIB (I am only using v3.0.1) and I don't convert any of my resources, I just put them into my the data directory as pngs, jpgs, etc. and they get converted automatically along with the rest of your source when you build your project.

You do have to add rules into your makefile like this though:

#---------------------------------------------------------------------------------
# This rule links in binary data with the .png extension for graphics
#---------------------------------------------------------------------------------
%.png.o :   %.png
#---------------------------------------------------------------------------------
	@echo $(notdir $<)
	$(bin2o)

and make sure the the data directory in your makefile is also set, like this:

DATA		:=	data 
Re: libwiigui alternatives in C not C++
April 12, 2009 07:33PM
Thanks guys you just saved my bacon, dont expect me to share it!

So i just use the files as i would normally do it using libfat without header files for images



Edited 1 time(s). Last edit at 04/12/2009 07:57PM by SteelSLasher.
Re: libwiigui alternatives in C not C++
April 13, 2009 09:26PM
I am curious, whats wrong with using C++?
Re: libwiigui alternatives in C not C++
April 13, 2009 09:33PM
its slower, compiles slower, and i dont like namespaces

if only C and C++ could be compiled together as one then my life would be complete, or can that be done (my wrapper failed)
Re: libwiigui alternatives in C not C++
April 13, 2009 10:49PM
Quote
SteelSLasher
its slower, compiles slower, and i dont like namespaces
I only use c++ and I've never used a namespace. I use alot of structs though. As far as compile time, I doubt I've waited longer than 30 seconds for a full compile for a game. Then again, what I compile might not be as extensive and robust as other stuff out there. But I've never had to complain about compile time. Besides....what's the rush?



Edited 1 time(s). Last edit at 04/13/2009 10:50PM by RazorChrist.
Re: libwiigui alternatives in C not C++
April 15, 2009 03:19AM
Yes you can indeed compile C and C++ :)
Its actually a myth that C++ compiles (or runs) slower. It was true 10+ years ago but compilers aren't crappy anymore. (but ppl dont learn and say C++ is slower). Theres no need to use namespaces.

To call C func you do
extern "C" {
myFunc();
}
or extern "C" myFunc()
note, you cant call c++ in c solely bc you cant include the cpp headers (theres no extern "C++").
If you rename your c files to c++ and put a big extern "C" {} around your code. You can call c++ func w/o breaking your other C files. But i'd rather rename all c files to c++ for simplicity.

I actually got rid of C 6+months ago and refused to code anything with it. Its all about C++, i cant wait for c++0x. I picked up C# a few weeks ago and liked it. I will do all my tools with it. I may use it in combo with boo (BooLangStudio)
Re: libwiigui alternatives in C not C++
April 15, 2009 12:19PM
i might just do that, hopefully libwiigui should help speed up my development

how would i reference the objects for each class



Edited 1 time(s). Last edit at 04/15/2009 12:23PM by SteelSLasher.
Sorry, only registered users may post in this forum.

Click here to login