Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Aug 2012
Offline Last Active Sep 23 2012 12:10 PM

Topics I've Started

Errors between C/C++ libs and windows.h

23 September 2012 - 11:47 AM

Hey Everyone

I'm currently having a problem with some libraries that I'm trying to import into my project. I have created an OBJ Loader in which you can load the contents of an "obj" file into some C arrays, which then passed into OpenGL (Glut) to render to the screen. My problem is that I have certain libraries conflicting with each other. Glut requires "windows.h" for the "gl.h" file. But I also need some other standard libraries such as:


So all together my code looks like this:

#include <SDL/SDL.h>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <cstdio>
#ifdef WIN32
#include <Windows.h>
#include <GL/glut.h>

From this I get a whole load of errors:


Any help will be appreciated!

P.s. I know that its conflictions between the libraries but I don't know what things to undefine.

Open GL OBJ Loader won't find file!

07 September 2012 - 01:56 PM

Hey Everyone

I recently decided that I would create a project based in Open GL to increase my knowledge of the API and create something that may be useful to me. So far I have followed some tutorials from a programmer on youtube called "TheCplusplusguy". Here's the begining tutorial for the "OpenGL (SDL,C++) tutorial 8 - Simple wavefront (.obj) model loader (part 1)" [ ].

So I followed the code along and made my adjustments where I saw fit in Visual Studio 2010. The program compiles correctly but for some reason will not load the "test.obj" file that is placed within the same folder as the compiled binary filles.

if(!in.is_open())	   //if not opened, exit with -1
				    std::cout << "File not found !" << std::endl;
				    return -1;

Is the algorithm used to tell the user in the console that the file was not opened/found.

int cube;
cube=loadObject("test.obj");    //load the test.obj file

Is the code that is used to tell Open GL what the filename is that I would like to use to render into the viewport. I have not mentioned that I have also tried creating two more separate projects in which I've used version 1 and 2 of the programmers obj loader code to see whether it not it was something I was missing. [ http://www.pastebin.com/6Q7zS7tC ] Was the place where he uploaded the code. Both projects compiled fine but I have the same problem.

I did exactly as he said with blender and even tried downloading and using the same version that he had in the tutorial. I can't seem to figure out why. May be there's something simple that I'm just forgetting.

Any help will be appreciated!
Thank you


What does this algorithm do?

29 August 2012 - 05:10 PM

Hey everyone

I was looking at a game engine to see how the different developers structure the code in their projects. I came across this algorithm but cannot figure out what it does exactly.

This algorithm is stored in a header file.

// Static compile-time assertion
namespace StaticAssert
template< bool > struct FAILED;
template<> struct FAILED< true > { };

#define ASSERT_STATIC( exp ) (StaticAssert::FAILED< (exp) != 0 >())

Can anyone explain what it does? "ASSERT_STATIC" is implemented in a cpp file. Here's the code:

// Check some platform-dependent assumptions
// Note: this function is never called but just wraps the compile time asserts
static void __ValidatePlatform__()
ASSERT_STATIC( sizeof( int64 ) == 8 );
ASSERT_STATIC( sizeof( int ) == 4 );
ASSERT_STATIC( sizeof( short ) == 2 );
ASSERT_STATIC( sizeof( char ) == 1 );

Thank you for reading!

UDK - Performance question

28 August 2012 - 03:39 PM

Hey everyone

I've been coming to this site for years but have only just decided to sign up. Hopefully I can help out the community and vice versa.
My question is about getting the best performance out of the UDK Package for my levels. I have gone through many different tutorials for the modelling suite "Maya" (2011), and I am currently in the progress of modelling a house that I would like to import into UDK later. I was thinking back to other projects I have seen in which houses had been developed via using the BSP geometry and just attaching textures to them. I was wondering would it be better for me to model my houses via Maya and then import them or to attempt to create them with BSP's instead. Is there going to be any deterioration in frame rate from using one or the over?

Thank you to anyone, and hopefully I don't sound stupid.