User forums > Help

Code::Blocks autocompletion not working

<< < (2/2)

ollydbg:

--- Quote from: thecheeselover on November 21, 2012, 04:26:55 pm ---I'd like Code::Blocks to do like intellisense and show members/functions. For now, Code::Blocks shows me nothing

--- End quote ---
show us sample code and tell us how to reproduce your issue.

thecheeselover:
The code is a little dirty, but I'll guide you.


--- Code: ---#define GLEW_STATIC
#include <glew.h>

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>

#include "../UnforeseenCosmosCore/Math/Matrix4x4.h"
#include "../UnforeseenCosmosCore/Math/Vector3.h"

#define PI 3.14159

int main()
{
    sf::WindowSettings Settings;
Settings.DepthBits         = 24; // Request a 24 bits depth buffer
Settings.StencilBits       = 8;  // Request a 8 bits stencil buffer
Settings.AntialiasingLevel = 2;  // Request 2 levels of antialiasing

    // Create the main window
    sf::RenderWindow App(sf::VideoMode(600, 600, 32), "SFML window", sf::Style::Close, Settings);
   // App.PreserveOpenGLStates(true);
    App.UseVerticalSync(false);
    App.SetActive();

    // Load a sprite to display
    sf::Image Image;
    if (!Image.LoadFromFile("cb.bmp"))
        return EXIT_FAILURE;

    sf::Font MyFont;

    // Load from a font file on disk
    if (!MyFont.LoadFromFile("uni05_54.ttf"))
    {
        // Error...
    }

    sf::String text("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's\n"
                    "sktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", MyFont, 16);

    sf::Sprite Sprite(Image); // HERE

    Sprite.SetPosition(400.f - Sprite.GetSize().x / 2.f, 300.f - Sprite.GetSize().y / 2.f);

    // Set color and depth clear value

glClearColor(0.f, 0.f, 0.f, 0.f);

// Enable Z-buffer read and write
glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR);
glDepthMask(GL_TRUE);
glClearDepth(1.f);

// Setup a perspective projection
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glEnable(GL_TEXTURE_2D);
gluPerspective(90.f, 1.f, 0.1f, 5000.f);
gluLookAt(50.f, 50.f, 50.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f);

/*const float vertices[] =
{
    20.f, 0.f, 10.f,
    30.f, 20.f, 10.f,
    40.f, 0.f, 10.f
};*/

UCC::Vector3<float> v1(0.f, 10.f, 0.f), v2(10.f,  -10.f, 0.f), v3( -10.f,  -10.f, 0.f);
UCC::Matrix4x4<float> matrix;
matrix = UCC::Matrix4x4<float>::CreateFromRotationXYZ_S(PI / 6000.f, PI / 6000.f, PI / 6000.f);

// Start the game loop
    while (App.IsOpened())
    {
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Draw the sprite
       // App.Draw(Sprite);
glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR);
glDepthMask(GL_TRUE);
glClearDepth(1.f);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glEnable(GL_TEXTURE_2D);
gluPerspective(90.f, 1.f, 0.1f, 5000.f);
gluLookAt(50.f, 50.f, 50.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glBegin(GL_TRIANGLES);

    glColor3d(1.0, 0.0, 0.0);
    glVertex3f(v1.x, v1.y, v1.z);
    glColor3d(0.0, 1.0, 0.0);
    glVertex3f(v2.x, v2.y, v2.z);
    glColor3d(0.0, 0.0, 1.0);
    glVertex3f(v3.x, v3.y, v3.z);

glEnd();

v1.Transform(matrix);
v2.Transform(matrix);
v3.Transform(matrix);

App.Draw(Sprite);
        // Update the window
        App.Display();
    }

    return EXIT_SUCCESS;
}
--- End code ---

     If you take the variable App for exemple, you'll notice that I use two functions: Draw() and Display(). I had to search them on Internet because CB wasn't telling me the members/functions of App. Usually, in CB, you can call auto-completion with ctrl-j or sometimes with ctrl-space. It just doesn't work for me because, as I explained, I can't see members/functions, except for static ones. For exemple, before I write anything, I can see members/functions in the function main. As an other exemple, I can search with auto-complete the variable App, but not its members/functions.

Thank you,
thecheeeselover

Ryval:
This user is looking for something like this to take place when he types a "." or "->" to access the member variables or member functions.

http://i.imgur.com/ig1TkB2.png

He wishes for autocomplete to make use of a dropdown tooltip box and show the available member functions and variables.

Why that was so hard for stahta01 to understand and be mean about it? I don't know.

But yeah, this is what the OP is looking for, and so am I as a new user of Code Blocks coming from VS.

If anyone has any idea how to solve this issue, please respond here or message me.

ollydbg:

--- Quote from: Ryval on April 11, 2015, 11:10:55 pm ---This user is looking for something like this to take place when he types a "." or "->" to access the member variables or member functions.

http://i.imgur.com/ig1TkB2.png

He wishes for autocomplete to make use of a dropdown tooltip box and show the available member functions and variables.

Why that was so hard for stahta01 to understand and be mean about it? I don't know.

But yeah, this is what the OP is looking for, and so am I as a new user of Code Blocks coming from VS.

If anyone has any idea how to solve this issue, please respond here or message me.

--- End quote ---
Hi, Ryval, welcome to our forum. I just create a simple sfml project by our wizard, and I get the following auto completion.
See image shot below:

In-fact, I'm using my local build C::B with some of my patches applied against trunk head.

Can you try the latest nightly build version of C::B.

Navigation

[0] Message Index

[*] Previous page

Go to full version