Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Nobody

Pages: [1]
1
General / linking error on version 1.3
« on: June 23, 2008, 05:44:51 pm »
Hi

I`ve just updated to version 1.3 and now I get an linking error.
The code is not the problem because it works on 1.2 well.
I`m sure it is my mistake. Can someone help me.

I use codeblocks and Xp

Code: [Select]

Switching to target: default
Linking executable: game.exe
Info: resolving vtable for sf::Spriteby linking to __imp___ZTVN2sf6SpriteE (auto-import)
Info: resolving vtable for sf::Inputby linking to __imp___ZTVN2sf5InputE (auto-import)
.objs\main.o:main.cpp:(.text$_ZN2sf6SpriteD1Ev[sf::Sprite::~Sprite()]+0xb): variable 'vtable for sf::Sprite' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
.objs\main.o:main.cpp:(.text$_ZN2sf5InputD1Ev[sf::Input::~Input()]+0xb): variable 'vtable for sf::Input' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings


thanks

2
Window / Winapi edit box on sfml
« on: May 25, 2008, 04:12:15 pm »
Hi

I`ve read the Winapi Sfml turtorial.
In my project I want to use both. So I`ve loaded the background picture with sfml and I want to add the edit box and a button of Winapi on the picture.

There is nothing.
I took the handle of the sfml window View1 but notthing happened

Sorry, english is not my native language

Thank you

Code: [Select]

#include <SFML/Graphics.hpp>
#include <windows.h>

#define ID_ButtonStart  1

HWND Window;
HINSTANCE hInstance;
MSG Message;
HWND View1;

LRESULT CALLBACK OnEvent(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam);

INT WINAPI WinMain(HINSTANCE Instance, HINSTANCE, LPSTR, int Stil)
{
    // Define a class for our main window
    WNDCLASS WindowClass;
    WindowClass.style         = 0;
    WindowClass.lpfnWndProc   = &OnEvent;
    WindowClass.cbClsExtra    = 0;
    WindowClass.cbWndExtra    = 0;
    WindowClass.hInstance     = Instance;
    WindowClass.hIcon         = NULL;
    WindowClass.hCursor       = 0;
    WindowClass.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_BACKGROUND);
    WindowClass.lpszMenuName  = NULL;
    WindowClass.lpszClassName = "SFML App";
    RegisterClass(&WindowClass);

    Instance=hInstance;

    // Let's create the main window
    Window = CreateWindow("SFML App", "SFML Win32", WS_SYSMENU | WS_VISIBLE, 500, 300, 300, 500, NULL, NULL, Instance, NULL);

    // Let's create two SFML views
    View1 = CreateWindow("STATIC", NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,0,  0, 300, 500, Window, NULL, Instance, NULL);
    //HWND View2 = CreateWindow("STATIC", NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 400, 100, 300, 400, Window, NULL, Instance, NULL);
    ShowWindow(Window,Stil);
    UpdateWindow(Window);


    sf::RenderWindow SFMLView1(View1);
    //sf::RenderWindow SFMLView2(View2);

    // Load images to display
    sf::Image Image1, Image2;
    if (!Image1.LoadFromFile("Resources\\mainbackground.jpg") || !Image2.LoadFromFile("image2.jpg"))
        return EXIT_FAILURE;
    sf::Sprite Sprite1(Image1);
    //sf::Sprite Sprite2(Image2);

    // Loop until a WM_QUIT message is received


    Message.message = ~WM_QUIT;
    while (Message.message != WM_QUIT)
    {
        if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE))
        {
            // If a message was waiting in the message queue, process it
            TranslateMessage(&Message);
            DispatchMessage(&Message);
        }
        else
        {
            // Draw sprite 1 on view 1
            SFMLView1.Draw(Sprite1);


            // Draw sprite 2 on view 2
            //SFMLView2.Draw(Sprite2);

            // Display each view on screen
            SFMLView1.Display();
            //SFMLView2.Display();
        }
    }
    //return Message.wParam;


    // Destroy the main window
    DestroyWindow(Window);

    // Don't forget to unregister the window class
    UnregisterClass("SFML App", Instance);

    return EXIT_SUCCESS;
}

LRESULT CALLBACK OnEvent(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam)
{
    HWND hwndButtonStart,hwndButton1,hwndEdit;
    HDC hdc;
    RECT rect;
    PAINTSTRUCT ps;

    switch (Message)
    {
        case WM_CREATE:
        {
        hwndButtonStart = CreateWindow( "button",
                                   "starten",
                                   WS_CHILD | WS_VISIBLE,
                                   10,10,100,100,
                                   View1, (HMENU)ID_ButtonStart, hInstance, NULL) ;
        hwndButton1 = CreateWindow( TEXT("button"),
                        "Alle meine Entchen",
                        WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
                        50, 50, 500, 100,
                        Window, NULL, hInstance,NULL);

          hwndEdit = CreateWindow ("EDIT","",
                         WS_CHILD | WS_VISIBLE | WS_BORDER |ES_MULTILINE ,
                         1, 0, 600, 100, View1, NULL,
                         hInstance, NULL) ;

        return 0;
        }


        case WM_PAINT:
            InvalidateRect(Window, &rect, TRUE);
            hdc = BeginPaint (Window, &ps) ;

            //SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT)) ;
            //SetBkMode (hdc, TRANSPARENT) ;

            TextOut (hdc, 400, 600, "Hallo", lstrlen ("Hallo")) ;

            EndPaint (Window, &ps) ;
            return 0 ;

        case WM_COMMAND:

            switch(WParam)
            {
            case ID_ButtonStart:
                    Beep(100,100);
                    return 0;
            }
            return 0;

        case WM_CLOSE :
        {
            PostQuitMessage(0);
            return 0;
        }
    }

    return DefWindowProc(Handle, Message, WParam, LParam);
}


3
Network / I can`t get my ipaddress
« on: April 27, 2008, 01:30:02 pm »
Hi

i do not know my mistake, but i cant get my ipaddress.

I ve tried it in many different ways.

For example
Code: [Select]

    sf::IPAddress IP;
    IP.GetLocalAddress();


Codeblocks says...

Compiling: main.cpp
Linking executable: Network.exe
.objs\main.o:main.cpp:(.text+0x296): undefined reference to `sf::IPAddress::IPAddress()'
.objs\main.o:main.cpp:(.text+0x29b): undefined reference to `sf::IPAddress::GetLocalAddress()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings

sry english is not my native language

Pages: [1]
anything