Author Topic: Code Completion with SDL  (Read 3260 times)

Nicoteen

  • Guest
Code Completion with SDL
« on: September 13, 2009, 05:23:19 pm »
hello,
i have problems with the code completion feature of the editor. I'm using SDL. After writing "SDL_" it shows alle the defines, structures and enumerations from SDL, but no functions, like SDL_init(), at all. Also unions, like the SDL_Event union, doesn't show up. Strangely the functions from expansion libraries like SDL_gfxPrimitives.h or SDL_Framerate.h are shown. Do somebody know what i am doing wrong?
Maybe CodeCompletion didn't load the library correctly in its cache the first time. How can I tell the plugin to reload the libraries to the cache?

glu

  • Guest
Re: Code Completion with SDL
« Reply #1 on: April 05, 2010, 02:28:25 pm »
Hello,
The completion doesn't work with SDL functions like SDL_Init() because these function are declared with "extern DECLSPEC" :
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
Does anyone know how to activate completion in code::blocks with "extern DECLSPEC" functions?
have a good day!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code Completion with SDL
« Reply #2 on: April 05, 2010, 03:33:21 pm »
Hello,
The completion doesn't work with SDL functions like SDL_Init() because these function are declared with "extern DECLSPEC" :
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
Does anyone know how to activate completion in code::blocks with "extern DECLSPEC" functions?
have a good day!
If I recall correctly, there's discussion about parsing the "extern" statement. and there's also a patch to solve "this kind of problem", but strictly, this is not a bug, maybe. You can search the forum.

Solving this is quite easy, but it surely have side effect.
« Last Edit: April 06, 2010, 02:05:55 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.