SDL event.type?

this is my first time working with SDL and code::blocks my teacher gave us a website, http://lazyfoo.net/SDL_tutorials/lesson16/index.php

the problem i am having is with the event.type do i need a certain library?]
if not how do i declare it for a arrow key?

1
2
3
4
5
6
7
8
#include <cstdlib>
#include<iostream>
#include "SDL/SDL.h"

 if( event.type == SDL_KEYDOWN )

fails and says not declared in scope 
    
Not sure if that's your real code because you can't have if statements outside functions like that.

event is supposed to be a variable of type SDL_Event. In the tutorial you linked they have defined it as a global variable.
 
SDL_Event event;
Last edited on
Topic archived. No new replies allowed.