Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › [Worklog] Cross-Platform NURBS Surface Editor (C++, Qt, OpenGL)
New Posts  All Forums:Forum Nav:

[Worklog] Cross-Platform NURBS Surface Editor (C++, Qt, OpenGL) - Page 4

post #31 of 38
Thread Starter 
Well, I think I've managed to make an openGL widget and I'll follow an example later tonight to see if I can produce something. I believe all the functions beginning gl...() are openGL functions rather than Qt wrappers for openGL, which I wasn't expecting.

http://programanddesign.com/cpp/qt-opengl-code-example/

EDIT: Having realised that, I've got many more options for tutorials now!
Edited by Killhouse - 9/26/12 at 6:20am
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
post #32 of 38
Thread Starter 
*grumble grumble*

Cant seem to install the right libraries for compiling in Linux.

/usr/bin/ld: cannot find -lopengl32
/usr/bin/ld: cannot find -lglu32

Any ideas?

EDIT:

It's not documented anywhere, and google shows nothing, but I believe I've fixed this error.

Going from visual studio to Linux requires creating a .pro file, which is the Qt compilers version of a project file. When creating this, visual studio adds the library dependencies opengl32 and glu32. I just cut these out of the .pro file and it compiles just fine..
Edited by Killhouse - 9/26/12 at 12:40pm
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
post #33 of 38
Thread Starter 
Successfully compiled (Linux & Windows)!

I didn't code much of this myself, its mostly an example. But I've learnt a bit. I'm going to keep messing around and see what I can create smile.gif

02-01.png

This is the code for the openGL widget (the box)

header:
Code:
#ifndef __PANELONE__
#define __PANELONE__
#include <QtOpenGL/QGLWidget>

class panelOne_OpenGL : public QGLWidget
{
        Q_OBJECT

public:
        panelOne_OpenGL(QWidget *parent = NULL);
protected:
        void initializeGL();
        void resizeGL(int w, int h);
        void paintGL();
//      void mousePressEvent(QMouseEvent *event);
//      void mouseMoveEvent(QMouseEvent *event);
//      void keyPressEvent(QKeyEvent *event);
};

#endif

Implementation:
Code:
#include "panelOne_OpenGL.h"

panelOne_OpenGL::panelOne_OpenGL(QWidget *parent /* = NULL */)
{

}

void panelOne_OpenGL::initializeGL() {
        glDisable(GL_TEXTURE_2D);
        glDisable(GL_DEPTH_TEST);
        glDisable(GL_COLOR_MATERIAL);
        glEnable(GL_BLEND);
        glEnable(GL_POLYGON_SMOOTH);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glClearColor(0, 0, 0, 0);
        resizeGL(300,300);
}

void panelOne_OpenGL::resizeGL(int w, int h) {
        glViewport(0, 0, w, h);
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        glOrtho(0, w, 0, h, -1.0l, 1.0l); // set origin to bottom left corner
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
}

void panelOne_OpenGL::paintGL() {
        glClear(GL_COLOR_BUFFER_BIT);
        glColor3f(1,0,0);
        glBegin(GL_POLYGON);
        glVertex2f(0,0);
        glVertex2f(100,500);
        glVertex2f(500,100);
        glEnd();
}
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
post #34 of 38
Quote:
Originally Posted by Killhouse View Post

*grumble grumble*
Cant seem to install the right libraries for compiling in Linux.
/usr/bin/ld: cannot find -lopengl32
/usr/bin/ld: cannot find -lglu32
Any ideas?
EDIT:
It's not documented anywhere, and google shows nothing, but I believe I've fixed this error.
Going from visual studio to Linux requires creating a .pro file, which is the Qt compilers version of a project file. When creating this, visual studio adds the library dependencies opengl32 and glu32. I just cut these out of the .pro file and it compiles just fine..

Should have used Qt Creator instead. tongue.gif

Anyways, glad you got it fixed.
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
post #35 of 38
Thread Starter 
I actually used it to see if it would try and add the libraries too. It didnt...

If only Qt Creator was prettier rolleyes.gif
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
post #36 of 38
Quote:
Originally Posted by Killhouse View Post

I actually used it to see if it would try and add the libraries too. It didnt...
If only Qt Creator was prettier rolleyes.gif

Weird that it didn't...
Oh well, this makes me want to play around with Qt again.

Good progress, I think. thumb.gif
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
post #37 of 38
Thread Starter 
Quote:
Originally Posted by {Unregistered} View Post

Weird that it didn't...
Oh well, this makes me want to play around with Qt again.
Good progress, I think. thumb.gif

I think Qt in visual studio is adding those libraries for Windows, and the .pro maker is picking them up and trying to include them for Linux, which is wrong. So Creator does it correctly, I think.

Slow progress wink.gif
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
post #38 of 38
Thread Starter 
Hey all,

This is on hold for a week or so as am back to uni and kick-starting a bunch of projects.

See here -
http://www.overclock.net/t/1312204/ideas-on-short-range-data-transmission
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › [Worklog] Cross-Platform NURBS Surface Editor (C++, Qt, OpenGL)