CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2012
    Posts
    2

    Question visual c++ error(s) "intellisense : expected an expression please help!

    hello,
    i'm having many errors in visual c++
    here's the code:
    (i'm trying to do something in openGL)

    Code:
    #include <StdAfx.h>                     
    #include <windows.h>                                                   // Header File For Windows
    #include <gl\gl.h>                                // Header File For The OpenGL32 Library
    #include <gl\glu.h>
    #include <stdafx.h>   
    #define Vector3d  
    #define RM_SOLID
    #define l_length 
    #define IM_QUADS
    #define blockPosition
    #define pRenderer                                                    // Header File For The GLu32 Library
    HGLRC           hRC=NULL;                           // Permanent Rendering Context
    HDC             hDC=NULL;                           // Private GDI Device Context
    HWND            hWnd=NULL;                          // Holds Our Window Handle
    HINSTANCE       hInstance;                          // Holds The Instance Of The Application
    bool    keys[256];                              // Array Used For The Keyboard Routine
    bool    active=TRUE;                                // Window Active Flag Set To TRUE By Default
    bool    fullscreen=TRUE;                            // Fullscreen Flag Set To Fullscreen Mode By Default
    LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);               // Declaration For WndProc
    GLvoid ReSizeGLScene(GLsizei width, GLsizei height)             // Resize And Initialize The GL Window
    {
        if (height==0)                              // Prevent A Divide By Zero By
        {
            height=1;                           // Making Height Equal One
        }
     
        glViewport(0, 0, width, height);                    // Reset The Current Viewport
    	glMatrixMode(GL_PROJECTION);                        // Select The Projection Matrix
        glLoadIdentity();                           // Reset The Projection Matrix
     
        // Calculate The Aspect Ratio Of The Window
        gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
     
        glMatrixMode(GL_MODELVIEW);                     // Select The Modelview Matrix
        glLoadIdentity();                           // Reset The Modelview Matrix
    	int InitGL(GLvoid); 
    		// All Setup For OpenGL Goes Here
    		float l_length = 1.0f;
            float l_height = 1.0f;
            float l_width = 1.0f;
    
    Vector3d blockPosition(0.0f); 0.0f 0.0f);     
    pRenderer->PushMatrix();
        pRenderer->TranslateWorldMatrix(blockPosition.x, blockPosition.y, blockPosition.z);
        pRenderer->SetRenderMode(RM_SOLID);
        pRenderer->EnableImmediateMode(IM_QUADS);
        pRenderer->ImmediateColourAlpha(1.0f, 1.0f, 1.0f, 1.0f);
        pRenderer->ImmediateNormal(0.0f, 0.0f, -1.0f);
        pRenderer->ImmediateVertex(l_length, -l_height, -l_width);
        pRenderer->ImmediateVertex(-l_length, -l_height, -l_width);
        pRenderer->ImmediateVertex(-l_length, l_height, -l_width);
        pRenderer->ImmediateVertex(l_length, l_height, -l_width);
    
        pRenderer->ImmediateNormal(0.0f, 0.0f, 1.0f);
        pRenderer->ImmediateVertex(-l_length, -l_height, l_width);
        pRenderer->ImmediateVertex(l_length, -l_height, l_width);
        pRenderer->ImmediateVertex(l_length, l_height, l_width);
        pRenderer->ImmediateVertex(-l_length, l_height, l_width);
    
        pRenderer->ImmediateNormal(1.0f, 0.0f, 0.0f);
        pRenderer->ImmediateVertex(l_length, -l_height, l_width);
        pRenderer->ImmediateVertex(l_length, -l_height, -l_width);
        pRenderer->ImmediateVertex(l_length, l_height, -l_width);
        pRenderer->ImmediateVertex(l_length, l_height, l_width);
    
        pRenderer->ImmediateNormal(-1.0f, 0.0f, 0.0f);
        pRenderer->ImmediateVertex(-l_length, -l_height, -l_width);
        pRenderer->ImmediateVertex(-l_length, -l_height, l_width);
        pRenderer->ImmediateVertex(-l_length, l_height, l_width);
        pRenderer->ImmediateVertex(-l_length, l_height, -l_width);
    
        pRenderer->ImmediateNormal(0.0f, -1.0f, 0.0f);
        pRenderer->ImmediateVertex(-l_length, -l_height, -l_width);
        pRenderer->ImmediateVertex(l_length, -l_height, -l_width);
        pRenderer->ImmediateVertex(l_length, -l_height, l_width);
        pRenderer->ImmediateVertex(-l_length, -l_height, l_width);
    
        pRenderer->ImmediateNormal(0.0f, 1.0f, 0.0f);
        pRenderer->ImmediateVertex(l_length, l_height, -l_width);
        pRenderer->ImmediateVertex(-l_length, l_height, -l_width);
        pRenderer->ImmediateVertex(-l_length, l_height, l_width);
        pRenderer->ImmediateVertex(l_length, l_height, l_width);
        pRenderer->DisableImmediateMode();
    pRenderer->PopMatrix();
    
    
    
    
    ;
    
    {           
    
    }
    NOTE: the errors are all the "->"
    Note : i'm a N00b i found a tutorial which i tried and this is the result =(

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: visual c++ error(s) "intellisense : expected an expression please help!

    #define pRenderer

    What is that supposed to accomplish? You've #defined it as nothing, then you try to dereference it.

  3. #3
    Join Date
    Jul 2012
    Posts
    2

    Re: visual c++ error(s) "intellisense : expected an expression please help!

    how do i fix it?

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: visual c++ error(s) "intellisense : expected an expression please help!

    Quote Originally Posted by intercroc View Post
    how do i fix it?
    Beats me. I don't know why it's there or what it's supposed to be doing.

    If you're a noob, that code may be a little more than you're ready for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured