bancuri, glume, imagini, video, fun, bancuri online, bancuri tari, imagini haioase, videoclipuri haioase, distractie online Pe HaiSaRadem.ro vei gasi bancuri, glume, imagini, video, fun, bancuri online, bancuri tari, imagini haioase, videoclipuri haioase, distractie online. Nu ne crede pe cuvant, intra pe HaiSaRadem.ro ca sa te convingi.
Setting NGL on Windows

Introduction

The scope of this tutorial is to show how to build NGL library and demos (along with future projects) on Windows platforms.
The process is not as straigh-forward as it seems and will require some understanding of explained concepts from the reader.
It is strongly advised to install the same packages/software as it is described here otherwise it might not work.
The Solution and Projects were done using Visual Studio 2012 since I was also testing the new IDE and it doesn't offer backwards
compatibility with Visual Studio 2010. So installing VS2012 is a must.
The machine used in this tutorial, at the time of the writing is:

- nVidia Graphics card (GTX 5xx) - Support up to OpenGl 4.1 (Your card must support OpenGL 3.x or higher).
- Intel Ivy Bridge i3570k @ 5.0 Ghz (I don't recommend overclocking your CPU if you don't know what you are doing, but faster is better.)
- Asus Maximus V Gene Mobo.
- 4x2BG Kingstone HyperX DDR3 Memory modules @ 1.6Ghz XMP1. It doesn't really matter that much.
- RAID-0 Sandisk Extreme SSDs. I recommend an SSD. It HUGELY boosts the build process and usability of Visual Studio.
- Rest is irelevant :)

How to build (a.k.a compile) NGL video library on Windows platforms

First of all this will take some time!!! So grab some coffee, bear, tequila or whatever you want and get ready for the ride :)

Like every other build, first we need to setup the environment !!! Yuppy what joy... So...

PREREQUISITES:

1. Around 5 Gigabytes (not Gigabits) of HDD space :P
2. Be sure you have Administrator permissions. If you want to be sure that UAC is not preventing your operations you can temporarly disable it.
3. Visual Studio 2010 Redistributable - (x86) Version or (x64) Version.
4. Visual Studio 2012 - Download it from here. It is free, however I recommend registering to get your serial key so it will not "timeout" after 30 days.
5. Qt Opensource for Visual Studio 2010 - Download it from here. This is a must!!! SO INSTALL IT, don't argue (Good news is that we dont need the full SDK since we already have the libs compiled for Win32):)
You can find all their installers for all versions here: Full list
6. Boost C++ libraries - Boost Download Page Get BoostPro either (x86) or (x64) installer based on your operating system.
7. Bazaar Version Control - Bazaar Official Page.
8. Some more free time :)

So lets get started:) Next in the line of order is ...

INSTALLATION:

Nothing really fancy here but there are a couple of things you need to do when installing:) I will take them one by one:
1. Visual Studio 2012: Straight installation, nothing really special. Tip: you can choose not to install the Web, Silverlight etc development tools.
2. Qt Opensource for Visual Studio 2010: Again straight install.
3. Boost C++ libraries: Make sure you install them in C:\boost and not in any other location. In the default variants page select Visual Studio 10.0.
As variantss select everything that is Multithreaded. You can skip Single threaded runtimes.

Break time !!! Go grab another coffee while Boost is installing :))

4. Bazaar Version Control: During install be sure to have the option to add to add it to PATH environment variable.
5. Windows Environment Variables: Add the following locations to the PATH environement variable: ;C:\Qt\4.8.1\bin;C:\NGL\lib\;c:\Qt\4.8.1\lib;

If you correctly followed the above steps then your environement should be complete. You don't need to worry about Glut and Glew since they are part of the Visual Studio Solution.

Getting ready and building the NGL lib:

1. Go to Jon Macey Computer Animation Pages and follow the instructions to download the branch of NGL lib.
Hint: Open cmd.exe and run "cd \" and "bzr branch http://nccastaff.bournemouth.ac.uk/jmacey/Code/NGL"
2. Download this archive. Unpack it and put all of its content inside "C:\NGL".
3. Open the NGL.sln Solution File in Visual Studio 2012. (Yes, we are not going to use Qt for anything, but we need its libraries and dependencies)
4. Select the Release Build.

Important note:
In order to build the Debug release you will need to also install Visual Studio 2010 (Express will do) since the QT debug libraries are built for Visual Studio 2010.
If you don't have it and want to start the project in debug and attach the debugger you will get an error that "msvcr100d.dll and msvcp100d.dll" are missing. These are the debug version of the CRT libs and only come with Visual Studio.
They are not found in redistributables. There are ways around this but that is up to you to figure it out if you want. So you have been warned!

5. From [Build] menu select [Build Solution] option. If you dont have Administrator properties the build will fail from the start! Either disable UAC or run Visual Studio as admin.
6. The build will fail the first time no matter what you do:)) since we need to adapt the code to Visual Studio (Microsoft) compiler standard.
To do this, make the following modifications:

Error :
Code that needs to be added/changed :
error C1083: Cannot open include file: 'dbgcrt.h': No such file or directory c:\ngl\include\ngl\NGLassert.h 41 "dbgcrt.h" doesnt exist. Instead include "crtdbg.h"
error C2065: 'M_PI' : undeclared identifier C:\NGL\include\ngl\Util.h Go all the way up in the header file and add the following statement:
#define _USE_MATH_DEFINES
#include <math.h>
error C2162: expected macro formal parameter c:\ngl\include\ngl\NGLassert.h Find these lines:
#define NGL_ASSERT(X) \
{ \
std::string str = "Assertion failed :"; \
str += #a; \

and change "str += #a;" to "str += #X;"
None In NGLassert.h go to the end of the file and find these lines:

"//----------------------------------------------------------------------------------------------------------------------"
"#endif // #if defined(NGL_DEBUG)"
"#endif // __NGLASSERT_H__"

Select the above described code and OVERWRITE IT with the following one (we want asserts only in Debug mode and not in Release mode):

//Needed in case NGL_DEBUG is not declared (or else the compiler will complain about
//not knowning who NGL_ASSERT is and since we dont want to stop execution in Release mode).
#else
#define NGL_ASSERT(X) \
{ \
std::string str = "NULL Assert"; \
}
"//----------------------------------------------------------------------------------------------------------------------"
"#endif // #if defined(NGL_DEBUG)"
"#endif // __NGLASSERT_H__"

error C2061: syntax error : identifier 'int32_t' c:\ngl\include\ngl\ShaderProgram.h Add in the header file:
#include <cstdint>
error C1021: invalid preprocessor command 'warning' C:\NGL\src\Obj.cpp Unfortunatelly VS compiler doesn't follow the standard and "warning" preprocessor directive is unknown.
Change "#warning This is a warning" with "#pragma message("This is a warning");" or simply comment the #warning

Once the above errors are taken care of, the build should succeed and in C:\NGL\lib you should end up with NGL.lib (At the time of writting Dynamic Linkage is not working yet as one link error still exists... Missing lib?).

Video showing the process of building the lib... To come!

Running a the SimpleNGL demo

1. Go to Jon Macey Computer Animation Pages and download the SimpleNGL demo uzing bzr. For example: C:\Demos\SimpleNGL
2. Download and extract the files from this archive and put it inside SimpleNGL folder.
3. Open NGL.sln from C:\NGL folder.
4. In Solution Explorer from Visual Studio select Solution 'NGL'.
5. Right click and select [Add]->[Existing Project].
6. Navigate to C:\Demos\SimpleNGL and select the project. It is now imported in our main solution!
7. Rename the project to SimpleNGL.
8. While the project is selected, right-click and select [Set as StartUp Project].
9. Create new Filters (Right-click on Project and select [Add]->[New Filter]) named "Header Files", "Resource Files", "Source Files" and put the files accordingly ( .cpp in Source Files, .h in Header Files and all other files in Resource Files).
10. Be sure that again Visual Studio is running as admin and that Release Build is selected.
11. Like before, from [Build] menu select [Build Solution] option. Or from Solution explore you can select the SimpleNGL project, right-click [Project Only]->[Build SimpleNGL Only] option so you don't build the NGL lib again.
12. The application should now be BUILT.

HURRAY!!!

Video showing the process of building the Demo app... To come!


Visual Studio Solution, Project files and this tutorial for NGL library written by Octavian Mihai Vasilovici