[SDL] A bug or it's my fault ?
G.Gabriele
netbone at tiscalinet.it
Tue Aug 8 11:48:54 PDT 2000
Hi all,
Well I have a problem doing that:
typedef struct {
Uint8 button;
Uint16 x,y;
}QML_Mouse;
QML_Mouse *QML_GetMouseClickEvent (void)
{
SDL_Event event;
while (SDL_WaitEvent(&event) >= 0)
{
switch(event.type)
{
case SDL_MOUSEBUTTONDOWN:
{
QML_Mouse *mouse;
Uint8 m_button;
Uint16 m_x, m_y;
/* THIS works fine */
m_button = event.button.button;
m_x = event.button.x;
m_y = event.button.y;
/* -------------- */
/* I GET Fatal signal: Segmentation Fault (SDL Parachute
Deployed) DOING the following : */
/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
mouse->button = m_button;
mouse->x = m_x;
mouse->y = m_y;
/*
--------------------------------------------------------------------------------------
*/
#if defined DEBUG
fprintf(stderr, "QML: mouse button %d, pressed at x: %d, y: %d\n",
m_button, m_x, m_y);
#endif
return mouse;
}
}
}
return NULL; /* NO COMPLAIN */
}
I'm using SDL 1.1.3
Thanks.
--
+ g.gabriele at europe.com ---------------+
| |
+------------------ think Open Source -+
More information about the SDL
mailing list