# Difference of SDL\_CreateWindowFrom and SDL\_CreateWindow

**URL:** <https://discourse.libsdl.org/t/difference-of-sdl-createwindowfrom-and-sdl-createwindow/21379>\
**Category:** SDL Development\
**Created:** [May 14, 2015, 5:10pm UTC](https://discourse.libsdl.org/t/difference-of-sdl-createwindowfrom-and-sdl-createwindow/21379 "2015-05-14T17:10:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rchu](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/d9b06d/32.png) [@rchu](https://discourse.libsdl.org/u/rchu)\
**Post date:** [May 14, 2015, 5:10pm UTC](https://discourse.libsdl.org/t/difference-of-sdl-createwindowfrom-and-sdl-createwindow/21379/1 "2015-05-14T17:10:36Z")

</div>

My workspace is Windows / MSVC / SDL2.

What I need is just catching the joystick actions in my application window (without OpenGL rendering).

When I use SDL\_CreateWindow to create a new window in a worker thread, like this:

ThreadProc()  
{  
SDL\_Init(SDL\_INIT\_EVERYTHING);  
SDL\_CreateWindow(…)  
SDL\_JoystickOpen(…)  
while(1)  
{  
SDL\_WaitEvent(…)  
switch(event.type)  
{  
case SDL\_JOYAXISMOTION:  
case SDL\_JOYBUTTONDOWN:  
case SDL\_JOYBUTTONUP:  
}  
}  
}

It works well. But when I use SDL\_CreateWindowFrom instead of SDL\_CreateWindow, I just want to attach the event pumping to a window of myself.  
It looks strange that I can only get SDL\_JOYBUTTONUP event, and the SDL\_JOYAXISMOTION and SDL\_JOYBUTTONDOWN are missing.

As a stranger of SDL, I wonder if I was using SDL improperly, or SDL2 does not support Windows well?

Any help is appreciated.
