You have a small bug in your code where you
#define GLEW_STATIC
. In order to use GLEW properly as a static library,GLEW_STATIC
must be declared before you includeglew.h
. You'll also likely have to change"glew32.lib"
to"glew32s.lib"
. Example:#pragma comment(lib, "glew32s.lib") ... #define GLEW_STATIC #include "glew.h"
Please don't ever use
using namespace std;
in your C++ code. It's a very bad idea. See this Stack Overflow post this Stack Overflow post for the reason why.The variable
bodyIndex
is poorly named and unnecessary.std::vector<T>
already has asize()
function which returns the number of elements in the vector.While you mentioned that you know you used the fixed function pipeline, I'm going to recommend against it anyways. It's deprecated in a lot of graphics hardware and sometimes requires some special workarounds to get working. It's also much less flexible than the programmable function pipeline.
The various
#include
s and#define
s at the beginning of your code are are grouped together in one big cluster, which isn't very visually appealing. I'd highly recommend separating them into distinct groups, like so:#pragma comment(lib, "glew32.lib") ... #include <stdlib.h> #include <string> #include <vector> #include <iostream> #include <fstream> ... #define GLEW_STATIC #include "GL/glew.h" #include <glut.h> ... #define WIDTH 800 #define HEIGHT 640 #define AU (149.6e6 * 1000) #define SCALE (250 / AU) #define G 6.67428e-11 ...
As you can see, there are four distinct groups here,
#pragma
s, standard#include
s, 3rd-party#include
s and#define
s.
You have a small bug in your code where you
#define GLEW_STATIC
. In order to use GLEW properly as a static library,GLEW_STATIC
must be declared before you includeglew.h
. You'll also likely have to change"glew32.lib"
to"glew32s.lib"
. Example:#pragma comment(lib, "glew32s.lib") ... #define GLEW_STATIC #include "glew.h"
Please don't ever use
using namespace std;
in your C++ code. It's a very bad idea. See this Stack Overflow post for the reason why.The variable
bodyIndex
is poorly named and unnecessary.std::vector<T>
already has asize()
function which returns the number of elements in the vector.While you mentioned that you know you used the fixed function pipeline, I'm going to recommend against it anyways. It's deprecated in a lot of graphics hardware and sometimes requires some special workarounds to get working. It's also much less flexible than the programmable function pipeline.
The various
#include
s and#define
s at the beginning of your code are are grouped together in one big cluster, which isn't very visually appealing. I'd highly recommend separating them into distinct groups, like so:#pragma comment(lib, "glew32.lib") ... #include <stdlib.h> #include <string> #include <vector> #include <iostream> #include <fstream> ... #define GLEW_STATIC #include "GL/glew.h" #include <glut.h> ... #define WIDTH 800 #define HEIGHT 640 #define AU (149.6e6 * 1000) #define SCALE (250 / AU) #define G 6.67428e-11 ...
As you can see, there are four distinct groups here,
#pragma
s, standard#include
s, 3rd-party#include
s and#define
s.
You have a small bug in your code where you
#define GLEW_STATIC
. In order to use GLEW properly as a static library,GLEW_STATIC
must be declared before you includeglew.h
. You'll also likely have to change"glew32.lib"
to"glew32s.lib"
. Example:#pragma comment(lib, "glew32s.lib") ... #define GLEW_STATIC #include "glew.h"
Please don't ever use
using namespace std;
in your C++ code. It's a very bad idea. See this Stack Overflow post for the reason why.The variable
bodyIndex
is poorly named and unnecessary.std::vector<T>
already has asize()
function which returns the number of elements in the vector.While you mentioned that you know you used the fixed function pipeline, I'm going to recommend against it anyways. It's deprecated in a lot of graphics hardware and sometimes requires some special workarounds to get working. It's also much less flexible than the programmable function pipeline.
The various
#include
s and#define
s at the beginning of your code are are grouped together in one big cluster, which isn't very visually appealing. I'd highly recommend separating them into distinct groups, like so:#pragma comment(lib, "glew32.lib") ... #include <stdlib.h> #include <string> #include <vector> #include <iostream> #include <fstream> ... #define GLEW_STATIC #include "GL/glew.h" #include <glut.h> ... #define WIDTH 800 #define HEIGHT 640 #define AU (149.6e6 * 1000) #define SCALE (250 / AU) #define G 6.67428e-11 ...
As you can see, there are four distinct groups here,
#pragma
s, standard#include
s, 3rd-party#include
s and#define
s.
You have a small bug in your code where you
#define GLEW_STATIC
. In order to use GLEW properly as a static library,GLEW_STATIC
must be declared before you includeglew.h
. You'll also likely have to change"glew32.lib"
to"glew32s.lib"
. Example:#pragma comment(lib, "glew32s.lib") ... #define GLEW_STATIC #include "glew.h"
Please don't ever use
using namespace std;
in your C++ code. It's a very bad idea. See this Stack Overflow post for the reason why.The variable
bodyIndex
is poorly named and unnecessary.std::vector<T>
already has asize()
function which returns the number of elements in the vector.While you mentioned that you know you used the fixed function pipeline, I'm going to recommend against it anyways. It's deprecated in a lot of graphics hardware and sometimes requires some special workarounds to get working. It's also much less flexible than the programmable function pipeline.
The various
#include
s and#define
s at the beginning of your code are are grouped together in one big cluster, which isn't very visually appealing. I'd highly recommend separating them into distinct groups, like so:#pragma comment(lib, "glew32.lib") ... #include <stdlib.h> #include <string> #include <vector> #include <iostream> #include <fstream> ... #define GLEW_STATIC #include "GL/glew.h" #include <glut.h> ... #define WIDTH 800 #define HEIGHT 640 #define AU (149.6e6 * 1000) #define SCALE (250 / AU) #define G 6.67428e-11 ...
As you can see, there are four distinct groups here,
#pragma
s, standard#include
s, 3rd-party#include
s and#define
s.
You have a small bug in your code where you
#define GLEW_STATIC
. In order to use GLEW properly as a static library,GLEW_STATIC
must be declared before you includeglew.h
. You'll also likely have to change"glew32.lib"
to"glew32s.lib"
. Example:#pragma comment(lib, "glew32s.lib") ... #define GLEW_STATIC #include "glew.h"
Please don't ever use
using namespace std;
in your C++ code. It's a very bad idea. See this Stack Overflow post for the reason why.The variable
bodyIndex
is poorly named and unnecessary.std::vector<T>
already has asize()
which returns the number of elements in the vector.While you mentioned that you know you used the fixed function pipeline, I'm going to recommend against it anyways. It's deprecated in a lot of graphics hardware and sometimes requires some special workarounds to get working. It's also much less flexible than the programmable function pipeline.
The various
#include
s and#define
s at the beginning of your code are are grouped together in one big cluster, which isn't very visually appealing. I'd highly recommend separating them into distinct groups, like so:#pragma comment(lib, "glew32.lib") ... #include <stdlib.h> #include <string> #include <vector> #include <iostream> #include <fstream> ... #define GLEW_STATIC #include "GL/glew.h" #include <glut.h> ... #define WIDTH 800 #define HEIGHT 640 #define AU (149.6e6 * 1000) #define SCALE (250 / AU) #define G 6.67428e-11 ...
As you can see, there are four distinct groups here,
#pragma
s, standard#include
s, 3rd-party#include
s and#define
s.
You have a small bug in your code where you
#define GLEW_STATIC
. In order to use GLEW properly as a static library,GLEW_STATIC
must be declared before you includeglew.h
. You'll also likely have to change"glew32.lib"
to"glew32s.lib"
. Example:#pragma comment(lib, "glew32s.lib") ... #define GLEW_STATIC #include "glew.h"
Please don't ever use
using namespace std;
in your C++ code. It's a very bad idea. See this Stack Overflow post for the reason why.The variable
bodyIndex
is poorly named and unnecessary.std::vector<T>
already has asize()
function which returns the number of elements in the vector.While you mentioned that you know you used the fixed function pipeline, I'm going to recommend against it anyways. It's deprecated in a lot of graphics hardware and sometimes requires some special workarounds to get working. It's also much less flexible than the programmable function pipeline.
The various
#include
s and#define
s at the beginning of your code are are grouped together in one big cluster, which isn't very visually appealing. I'd highly recommend separating them into distinct groups, like so:#pragma comment(lib, "glew32.lib") ... #include <stdlib.h> #include <string> #include <vector> #include <iostream> #include <fstream> ... #define GLEW_STATIC #include "GL/glew.h" #include <glut.h> ... #define WIDTH 800 #define HEIGHT 640 #define AU (149.6e6 * 1000) #define SCALE (250 / AU) #define G 6.67428e-11 ...
As you can see, there are four distinct groups here,
#pragma
s, standard#include
s, 3rd-party#include
s and#define
s.
In C++ (and even later versions of C), it's always better to use const
(or constexpr
in some special cases) for defining constant values rather than a macro. This means that theUsing macros can often lead to obscure and confusing issues popping up, especially if you're overzealous in your use of them. The macros in your code (excluding GLEW_STATIC
) should be declared as:
You have a small bug in your code where you
#define GLEW_STATIC
. In order to use GLEW properly as a static library,GLEW_STATIC
must be declared before you includeglew.h
. You'll also likely have to change"glew32.lib"
to"glew32s.lib"
. Example:#pragma comment(lib, "glew32s.lib") ... #define GLEW_STATIC #include "glew.h"
Please don't ever use
using namespace std;
in your C++ code. It's a very bad idea. See this Stack Overflow post for the reason why.The variable
bodyIndex
is poorly named and unnecessary.std::vector<T>
already has asize()
which returns the number of elements in the vector.While you mentioned that you know you used the fixed function pipeline, I'm going to recommend against it anyways. It's deprecated in a lot of graphics hardware and sometimes requires some special workarounds to get working. It's also much less flexible than the programmable function pipeline.
The various
#include
s and#define
s at the beginning of your code are are grouped together in one big cluster, which isn't very visually appealing. I'd highly recommend separating them into distinct groups, like so:#pragma comment(lib, "glew32.lib") ... #include <stdlib.h> #include <string> #include <vector> #include <iostream> #include <fstream> ... #define GLEW_STATIC #include "GL/glew.h" #include <glut.h> ... #define WIDTH 800 #define HEIGHT 640 #define AU (149.6e6 * 1000) #define SCALE (250 / AU) #define G 6.67428e-11 ...
As you can see, there are four distinct groups here,
#pragma
s, standard#include
s, 3rd-party#include
s and#define
s.
In C++ (and even later versions of C), it's always better to use const
(or constexpr
in some special cases) for defining constant values rather than a macro. This means that the macros in your code (excluding GLEW_STATIC
) should be declared as:
You have a small bug in your code where you
#define GLEW_STATIC
. In order to use GLEW properly as a static library,GLEW_STATIC
must be declared before you includeglew.h
. You'll also likely have to change"glew32.lib"
to"glew32s.lib"
. Example:#pragma comment(lib, "glew32s.lib") ... #define GLEW_STATIC #include "glew.h"
Please don't ever use
using namespace std;
in your C++ code. It's a very bad idea. See this Stack Overflow post for the reason why.The variable
bodyIndex
is poorly named and unnecessary.std::vector<T>
already has asize()
which returns the number of elements in the vector.While you mentioned that you know you used the fixed function pipeline, I'm going to recommend against it anyways. It's deprecated in a lot of graphics hardware and sometimes requires some special workarounds to get working. It's also much less flexible than the programmable function pipeline.
In C++ (and even later versions of C), it's always better to use const
(or constexpr
in some special cases) for defining constant values rather than a macro. Using macros can often lead to obscure and confusing issues popping up, especially if you're overzealous in your use of them. The macros in your code (excluding GLEW_STATIC
) should be declared as:
You have a small bug in your code where you
#define GLEW_STATIC
. In order to use GLEW properly as a static library,GLEW_STATIC
must be declared before you includeglew.h
. You'll also likely have to change"glew32.lib"
to"glew32s.lib"
. Example:#pragma comment(lib, "glew32s.lib") ... #define GLEW_STATIC #include "glew.h"
Please don't ever use
using namespace std;
in your C++ code. It's a very bad idea. See this Stack Overflow post for the reason why.The variable
bodyIndex
is poorly named and unnecessary.std::vector<T>
already has asize()
which returns the number of elements in the vector.While you mentioned that you know you used the fixed function pipeline, I'm going to recommend against it anyways. It's deprecated in a lot of graphics hardware and sometimes requires some special workarounds to get working. It's also much less flexible than the programmable function pipeline.
The various
#include
s and#define
s at the beginning of your code are are grouped together in one big cluster, which isn't very visually appealing. I'd highly recommend separating them into distinct groups, like so:#pragma comment(lib, "glew32.lib") ... #include <stdlib.h> #include <string> #include <vector> #include <iostream> #include <fstream> ... #define GLEW_STATIC #include "GL/glew.h" #include <glut.h> ... #define WIDTH 800 #define HEIGHT 640 #define AU (149.6e6 * 1000) #define SCALE (250 / AU) #define G 6.67428e-11 ...
As you can see, there are four distinct groups here,
#pragma
s, standard#include
s, 3rd-party#include
s and#define
s.