Author Topic: OpenGL Auto Completion  (Read 7866 times)

rust

  • Guest
OpenGL Auto Completion
« on: May 19, 2008, 05:04:00 pm »
hello everyone,

I'm new at Code::Blocks. I have to work on a OpenGL Project, so I downloaded C::B for Mac (intel) for my macbook.

I followed wizard to create a simple glut application ( GLUT Shapes Demo
). GLUT example is running but in the editor auto Completion is not working.

I tried to write gl... (ctrl+space) in the existing code, but nothing.

Any ideas?

thank you

Offline Deschamps

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: OpenGL Auto Completion
« Reply #1 on: May 19, 2008, 10:19:40 pm »
If I'm not wrong, code completion needs at least you write 4 chars (for objects or members names) before it shows you the possible choices.

Regards.
Those who were seen dancing were thought to be insane by those who could not hear the music

rust

  • Guest
Re: OpenGL Auto Completion
« Reply #2 on: May 20, 2008, 06:56:16 pm »
mmm no.. it's not running even typing 4 chars

Offline XayC

  • Multiple posting newcomer
  • *
  • Posts: 94
Re: OpenGL Auto Completion
« Reply #3 on: May 20, 2008, 10:15:32 pm »
The Code Completion plug-in has some known issues. It may not be able to correctly parse some headers; if the OpenGL/GLUT header that you are using is one of them I don't know, but it may be the cause of your problem.

If you want more information about this you can look in the Code Completion Redesign section of the forums or in the bugs list for the Code Completion component on Berlios.

Regards, XayC

Offline dje

  • Lives here!
  • ****
  • Posts: 682
Re: OpenGL Auto Completion
« Reply #4 on: May 21, 2008, 08:40:35 am »
If I'm not wrong, code completion needs at least you write 4 chars (for objects or members names) before it shows you the possible choices.

Regards.


I think the 4 chars are those after which autocompletion panel appears automatically but you can press Ctrl+space before those 4 chars.

Dje

Offline Ibbur

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: OpenGL Auto Completion
« Reply #5 on: May 21, 2008, 11:06:43 am »
I think the problem is, that externs are skipped.

The gl... functions are preceded with the macro GLAPI. Now look, how GLAPI is defined in gl.h:
Quote from: gl.h
Code
#if !defined(GLAPI)
#  if defined(_MSC_VER)                        /* Microsoft Visual C++ */
#    define GLAPI __declspec(dllimport)
#  elif defined(__LCC__) && defined(__WIN32__) /* LCC-Win32 */
#    define GLAPI __stdcall
#  else                                        /* Others (e.g. MinGW, Cygwin, non-win32) */
#    define GLAPI extern
#  endif
#endif

Offline dje

  • Lives here!
  • ****
  • Posts: 682
Re: OpenGL Auto Completion
« Reply #6 on: May 21, 2008, 11:09:58 am »
AFAIK, macro are not managed by code completion plugin, that's why your symbols are not found.

Dje

Offline Ibbur

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: OpenGL Auto Completion
« Reply #7 on: May 21, 2008, 11:35:12 am »
Preprocessor parsing can be enabled in the editor settings dialog:


Using a patched version (look at the link, posted above), that does not skip externs, completion with gl... functions works for me:

lowtraxx

  • Guest
Re: OpenGL Auto Completion
« Reply #8 on: May 23, 2008, 02:48:58 am »
Hi,

tried this workaround, but doesnt work here. (Applied the patch, but i think the file changed since the last entry.) Still getting no Autocompletion of gl.h. Does someone have another solution?

thx

Low