Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Как гапустить библиотеку ГЛУТ в Куте 6



  • Раньше нормально подключалась библиотека GLUT а тепеть как то не выходит.
    Есть ли аналог этой библиотеки, либо что то похожее в самом куте ??

    parbola .pro

    #QT -= gui
    
    CONFIG += c++11 console qt widgets
    CONFIG -= app_bundle
    #CONFIG -= qt
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    QT += opengl
    LIBS += -lopengl32 \ # при виндовсе открой
            -lglut32  \
             -lglew32  \
            -lglfw3   \
            -lgdi32
    
    SOURCES += main.cpp
    #-
    INCLUDEPATH += $$PWD/glfw_bin/include/GLFW/ \ # добавляем для удобства чтоб напрямую писать
                   $$PWD/glew_bin/include/GL/  \ # только название заголовчного файла без полного пути
                   $$PWD/stb_image/
    
    HEADERS += \
        glfw_bin/include/GLFW/glfw3.h \
        glfw_bin/include/GLFW/glfw3native.h \
        glew_bin/include/GL/glew.h \
    
    
    #win32: LIBS += -L$$PWD/glew_bin/lib/Release/Win32/ -llibglew32.dll
    
    #INCLUDEPATH += $$PWD/glew_bin/lib/Release/Win32
    #DEPENDPATH += $$PWD/glew_bin/lib/Release/Win32
    
    #win32: LIBS += -L$$PWD/glew_bin/lib/Release/Win32/ -lglew32
    
    #INCLUDEPATH += $$PWD/glew_bin/lib/Release/Win32
    #DEPENDPATH += $$PWD/glew_bin/lib/Release/Win32
    ##-
    #win32: LIBS += -L$$PWD/glfw_bin/lib-mingw/ -lglfw3
    
    #INCLUDEPATH += $$PWD/glfw_bin/lib-mingw
    #DEPENDPATH += $$PWD/glfw_bin/lib-mingw
    
    #win32: LIBS += -L$$PWD/glfw_bin/lib-mingw/ -lglfw3dll
    
    #INCLUDEPATH += $$PWD/glfw_bin/lib-mingw
    #DEPENDPATH += $$PWD/glfw_bin/lib-mingw
    
    #win32: LIBS += -L$$PWD/glut/ -lglut32
    
    #INCLUDEPATH += $$PWD/glut
    #DEPENDPATH += $$PWD/glut
    
    #win32: LIBS += -L$$PWD/../../../Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/lib/ -lglu32
    
    #INCLUDEPATH += $$PWD/../../../Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/include
    #DEPENDPATH += $$PWD/../../../Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/include
    
    
    
    
    #-  дошло до смешного надо из компилятора библиатеки подлягивать а то он не справляеться :3
    #win32: LIBS += -LC:/Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/lib -lgdi32
    #INCLUDEPATH += C:/Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/include
    #DEPENDPATH += C:/Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/include
    # если что то там есть  все "библиотеки" подкачанные виндой.
    #C:\Windows\System32
    #--#
    #win32: LIBS += -LC:/Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/lib/ -lglut32
    #INCLUDEPATH += C:/Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/include
    #DEPENDPATH += C:/Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/include
    
    #win64: LIBS += -L$$PWD/glew_bin/lib/Release/Win32/ -llibglew32.dll
    
    #INCLUDEPATH += $$PWD/glew_bin/lib/Release/Win32
    #DEPENDPATH += $$PWD/glew_bin/lib/Release/Win32
    
    win64: LIBS += -L$$PWD/glew_bin/lib/Release/x64/ -lglew32
    
    INCLUDEPATH += $$PWD/glew_bin/lib/Release/x64
    DEPENDPATH += $$PWD/glew_bin/lib/Release/x64
    #-
    win64: LIBS += -L$$PWD/glfw_bin/lib-mingw-w64/ -lglfw3
    
    INCLUDEPATH += $$PWD/glfw_bin/lib-mingw-w64
    DEPENDPATH += $$PWD/glfw_bin/lib-mingw-w64
    
    win64: LIBS += -L$$PWD/glfw_bin/lib-mingw/ -lglfw3dll
    
    INCLUDEPATH += $$PWD/glfw_bin/lib-mingw
    DEPENDPATH += $$PWD/glfw_bin/lib-mingw
    
    win64: LIBS += -L$$PWD/glut/ -lglut32
    
    INCLUDEPATH += $$PWD/glut
    DEPENDPATH += $$PWD/glut
    
    #win64: LIBS += -L$$PWD/../../../Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/lib/ -lglu32
    
    #INCLUDEPATH += $$PWD/../../../Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/include
    #DEPENDPATH += $$PWD/../../../Qt/Qt5.13.0/Tools/mingw730_32/i686-w64-mingw32/include
    
    
    
    
    # --- linux ---
    # хоть заголовочный и не вызываеться всетаки функции вызываються
    unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/lib/x86_64-linux-gnu/ -lOpenGL
    
    INCLUDEPATH += $$PWD/../../../../../../../usr/include/GL
    DEPENDPATH += $$PWD/../../../../../../../usr/include/GL
    
    unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/lib/x86_64-linux-gnu/ -lGLEW
    
    INCLUDEPATH += $$PWD/../../../../../../../usr/include/GL
    DEPENDPATH += $$PWD/../../../../../../../usr/include/GL
    
    unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/lib/x86_64-linux-gnu/ -lglfw
    
    INCLUDEPATH += $$PWD/../../../../../../../usr/include/GLFW
    DEPENDPATH += $$PWD/../../../../../../../usr/include/GLFW
    
    #unix:!macx: LIBS += -L$$PWD/../../../../../../usr/lib/x86_64-linux-gnu/ -lglfw3
    
    #INCLUDEPATH += $$PWD/../../../../../../usr/include/GLFW
    #DEPENDPATH += $$PWD/../../../../../../usr/include/GLFW
    

    main.cpp

    #include <cstdlib>
    #include <cmath>
    #include <iostream>
    
    #include <glew.h>
    #include <windows.h>
    #include <glut.h>
    
    using namespace std;
    
    // Globals.
    static int M = 3; // Number of vertices on one half of the parabola.
    
    // Drawing routine.
    void drawScene(void)
    {
       int i;
       glClear (GL_COLOR_BUFFER_BIT);
    
       glColor3f(0.0, 0.0, 0.0);
    
       // The 2M+1 vertices on the parabola are equally spaced in x-coordinates.
       // The parabola is translated and scaled to center it in the window.
       glBegin(GL_LINE_STRIP);
       for(i = -M; i <= M; ++i)
       {
          glVertex3f( 50.0 + 50.0 * (float)i/M, 100.0 * (float)(i*i)/(M*M), 0.0 );
       }
       glEnd();
    
       glFlush();
    }
    
    // Initialization routine.
    void setup(void)
    {
       glClearColor(1.0, 1.0, 1.0, 0.0);
    }
    
    // OpenGL window reshape routine.
    void resize(int w, int h)
    {
       glViewport(0, 0, w, h);
       glMatrixMode(GL_PROJECTION);
       glLoadIdentity();
       glOrtho(0.0, 100.0, 0.0, 100.0, -1.0, 1.0);
       glMatrixMode(GL_MODELVIEW);
       glLoadIdentity();
    }
    
    // Keyboard input processing routine.
    void keyInput(unsigned char key, int x, int y)
    {
       switch (key)
       {
          case 27:
             exit(0);
             break;
          case '+':
             M++;
             glutPostRedisplay();
             break;
          case '-':
             if (M > 2) M--;
             glutPostRedisplay();
             break;
          default:
             break;
       }
    }
    
    // Routine to output interaction instructions to the C++ window.
    void printInteraction(void)
    {
       cout << "Interaction:" << endl;
       cout << "Press +/- to increase/decrease the number of vertices on the parabola." << endl;
    }
    
    // Main routine.
    int main(int argc, char **argv)
    {
       printInteraction();
       glutInit(&argc, argv);
    
    //   glutInitContextVersion(4, 3);
    //   glutInitContextProfile(GLUT_COMPATIBILITY_PROFILE);
    
       glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
       glutInitWindowSize(500, 500);
       glutInitWindowPosition(100, 100);
       glutCreateWindow("parabola.cpp");
       glutDisplayFunc(drawScene);
       glutReshapeFunc(resize);
       glutKeyboardFunc(keyInput);
    
       glewExperimental = GL_TRUE;
       glewInit();
    
       setup();
    
       glutMainLoop();
    }
    

    cannot find lglut32
    cannot find lglew32
    cannot find lglfw32

    ![alt text](c554b32b-8de6-4529-a948-12164386c3c7-изображение.png image url)


Log in to reply