English 中文(简体)
SDL_WINDOWEV 失踪
原标题:SDL_WINDOWEVENT missing
  • 时间:2012-04-11 05:55:33
  •  标签:
  • c++
  • sdl

我正在使用SDL的最新版本,即SDL_WINDOWEVENT似乎失踪。

在SDL_Events.h内部,SDL_Events的定义是:

/** General event structure */
typedef union SDL_Event {
    Uint8 type;
    SDL_ActiveEvent active;
    SDL_KeyboardEvent key;
    SDL_MouseMotionEvent motion;
    SDL_MouseButtonEvent button;
    SDL_JoyAxisEvent jaxis;
    SDL_JoyBallEvent jball;
    SDL_JoyHatEvent jhat;
    SDL_JoyButtonEvent jbutton;
    SDL_ResizeEvent resize;
    SDL_ExposeEvent expose;
    SDL_QuitEvent quit;
    SDL_UserEvent user;
    SDL_SysWMEvent syswm;
} SDL_Event;

我知道有一个SDL。 WINDOWEVENT from the wiki

http://wiki.libsdl.org/moin.cgi/SDL_WindowEvent?highlight=%285CbategoryStruct%5Cb%29%7C%28CategoryEvents%7C%28SGStructures%29”rel=“nofollow” http://wiki.libsdl.org/moin.cgi/SDL_WindowEvent?highlight=285CbategoryStruct%5C%28C%28C%

页: 1 页: 1

澄清问题

如果你看看所提供的联系,则样本代码显示

void PrintEvent(const SDL_Event * event)
{
    if (event->type == SDL_WINDOWEVENT) {
        switch (event->window.event) {
        case SDL_WINDOWEVENT_SHOWN:
            fprintf(stderr, "Window %d shown", event->window.windowID);
            break;
// snip
}

My Code

    SDL_Event sdlEvent = {0};

    while(SDL_PollEvent(&sdlEvent))
    {
        if(sdlEvent.type == SDL_QUIT)// || isTriggered(SDLK_ESCAPE))
            System::getEventManagerGlobal().broadcastEvent( Event("QUIT") );
        if(sdlEvent.type == SDL_WINDOWEVENT)
        {
            if(sdlEvent.window.event == SDL_WINDOWEVENT_MOVED)
            {
                // snip
            }
        }
    }

error C2065: SDL_WINDOWEVENT : undeclared identifier error C2039: window : is not a member of SDL_Event sdl_events.h(227) : see declaration of SDL_Event error C2228: left of .event must have class/struct/union error C2065: SDL_WINDOWEVENT_MOVED : undeclared identifier

问题回答

我发现,我的问题——Joachim和用户1202136使我解冻。

我使用的SDL版本错了,这解释了为什么没有这种方法。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签