mettli / guichan

Automatically exported from code.google.com/p/guichan
Other
0 stars 0 forks source link

mingw+codeblocks binaries #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

is it possible to release binaries for VC & mingw in version 0.8.1?
(*.o and *.dll)
i've tried to compile from sources but i couldn't
it give me all kinds of strange errors

thanks in advance

Original issue reported on code.google.com by thenetce...@gmail.com on 10 Jul 2008 at 10:26

GoogleCodeExporter commented 9 years ago
No it's not possible because it's just to much work. It's not as simple as just
compiling binaries with VC or MinGW as they might or might not work with other
versions of VC or MinGW. To make a proper release we need to compile Guichan 
with
every single version of VC and MinGW.

Please use our forum at http://guichan.sf.net/forum to get help on how to 
compile
Guichan from source.

Original comment by olof.nae...@gmail.com on 13 Jul 2008 at 1:27

GoogleCodeExporter commented 9 years ago

i compiled the examples adding the sources to the project =)
thank you, that's the best way
this library is great! i am upgrading from version 0.5 to 0.8.1

#include <iostream>
#include "SDL.h"
#include "SDL_image.h"

#include <guichan/actionevent.hpp>
#include <guichan/actionlistener.hpp>
#include <guichan/basiccontainer.hpp>
#include <guichan/cliprectangle.hpp>
#include <guichan/color.hpp>
#include <guichan/deathlistener.hpp>
#include <guichan/defaultfont.hpp>
#include <guichan/event.hpp>
#include <guichan/exception.hpp>
#include <guichan/focushandler.hpp>
#include <guichan/focuslistener.hpp>
#include <guichan/font.hpp>
#include <guichan/genericinput.hpp>
#include <guichan/graphics.hpp>
#include <guichan/gui.hpp>
#include <guichan/image.hpp>
#include <guichan/imagefont.hpp>
#include <guichan/imageloader.hpp>
#include <guichan/input.hpp>
#include <guichan/inputevent.hpp>
#include <guichan/key.hpp>
#include <guichan/keyevent.hpp>
#include <guichan/keyinput.hpp>
#include <guichan/keylistener.hpp>
#include <guichan/listmodel.hpp>
#include <guichan/mouseevent.hpp>
#include <guichan/mouseinput.hpp>
#include <guichan/mouselistener.hpp>
#include <guichan/platform.hpp>
#include <guichan/rectangle.hpp>
#include <guichan/sdl.hpp>
#include <guichan/selectionevent.hpp>
#include <guichan/selectionlistener.hpp>
#include <guichan/widget.hpp>
#include <guichan/widgetlistener.hpp>

#include <actionevent.cpp>
#include <basiccontainer.cpp>
#include <cliprectangle.cpp>
#include <color.cpp>
#include <defaultfont.cpp>
#include <event.cpp>
#include <exception.cpp>
#include <focushandler.cpp>
#include <font.cpp>
#include <genericinput.cpp>
#include <graphics.cpp>
#include <gui.cpp>
#include <guichan.cpp>
#include <image.cpp>
#include <imagefont.cpp>
#include <inputevent.cpp>
#include <key.cpp>
#include <keyevent.cpp>
#include <keyinput.cpp>
#include <mouseevent.cpp>
#include <mouseinput.cpp>
#include <rectangle.cpp>
#include <selectionevent.cpp>
#include <widget.cpp>

#include <guichan/widgets/button.hpp>
#include <guichan/widgets/checkbox.hpp>
#include <guichan/widgets/container.hpp>
#include <guichan/widgets/dropdown.hpp>
#include <guichan/widgets/icon.hpp>
#include <guichan/widgets/imagebutton.hpp>
#include <guichan/widgets/label.hpp>
#include <guichan/widgets/listbox.hpp>
#include <guichan/widgets/radiobutton.hpp>
#include <guichan/widgets/scrollarea.hpp>
#include <guichan/widgets/slider.hpp>
#include <guichan/widgets/tab.hpp>
#include <guichan/widgets/tabbedarea.hpp>
#include <guichan/widgets/textbox.hpp>
#include <guichan/widgets/textfield.hpp>
#include <guichan/widgets/window.hpp>

#include <widgets/button.cpp>
#include <widgets/checkbox.cpp>
#include <widgets/container.cpp>
#include <widgets/dropdown.cpp>
#include <widgets/icon.cpp>
#include <widgets/imagebutton.cpp>
#include <widgets/label.cpp>
#include <widgets/listbox.cpp>
#include <widgets/radiobutton.cpp>
#include <widgets/scrollarea.cpp>
#include <widgets/slider.cpp>
#include <widgets/tab.cpp>
#include <widgets/tabbedarea.cpp>
#include <widgets/textbox.cpp>
#include <widgets/textfield.cpp>
#include <widgets/window.cpp>

// sdl specific

#include <guichan/sdl/sdlgraphics.hpp>
#include <guichan/sdl/sdlimage.hpp>
#include <guichan/sdl/sdlimageloader.hpp>
#include <guichan/sdl/sdlinput.hpp>
#include <guichan/sdl/sdlpixel.hpp>

#include <sdl/sdl.cpp>
#include <sdl/sdlgraphics.cpp>
#include <sdl/sdlimage.cpp>
#include <sdl/sdlimageloader.cpp>
#include <sdl/sdlinput.cpp>

SDL_Surface* screen;
SDL_Event event;

gcn::SDLInput* input;
gcn::SDLGraphics* graphics;
gcn::SDLImageLoader* imageLoader;

gcn::Gui* gui;
gcn::Container* top;
gcn::ImageFont* font;
gcn::Label* label;

void init()
{
    SDL_Init(SDL_INIT_VIDEO);
    screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE);
    SDL_EnableUNICODE(1);
    SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);

    imageLoader = new gcn::SDLImageLoader();
    gcn::Image::setImageLoader(imageLoader);
    graphics = new gcn::SDLGraphics();
    graphics->setTarget(screen);
    input = new gcn::SDLInput();

    font = new gcn::ImageFont("fixedfont.bmp", "
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
    gcn::Widget::setGlobalFont(font);

    gui = new gcn::Gui();
    gui->setGraphics(graphics);
    gui->setInput(input);

    top = new gcn::Container();
    top->setDimension(gcn::Rectangle(0, 0, 640, 480));
    gui->setTop(top);

    label = new gcn::Label("Hello World");
    label->setPosition(280, 220);
    top->add(label);
}

void run()
{
    bool running = true;

    while (running)
    {
        while(SDL_PollEvent(&event))
        {
            if (event.type == SDL_KEYDOWN)
            {
                if (event.key.keysym.sym == SDLK_ESCAPE)
                {
                    running = false;
                }

            }
            else if(event.type == SDL_QUIT)
            {
                running = false;
            }

           input->pushInput(event);
        }

       gui->logic();
       gui->draw();

       SDL_Flip(screen);
    }
}

void halt()
{
    delete label;
    delete font;
    delete top;
    delete gui;

    delete input;
    delete graphics;
    delete imageLoader;

    SDL_Quit();
}

int main(int argc, char *argv[])
{
    try
    {
        init();
        run();
        halt();
    }
    catch (gcn::Exception e)
    {
        std::cout << e.getMessage() << std::endl;
    }
    catch (std::exception e)
    {
        std::cout << "Std exception: " << e.what() << std::endl;
    }
    catch (...)
    {
        std::cout << "Unknown exception" << std::endl;
    }

    return 1;
}

Original comment by thenetce...@gmail.com on 13 Jul 2008 at 5:42

GoogleCodeExporter commented 9 years ago
You can always include just guichan.hpp, which includes all Guichan headers for 
you
so you don't have to include so many files.

Original comment by olof.nae...@gmail.com on 13 Jul 2008 at 5:58