Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


eDuDe

Member Since 05 May 2008
Offline Last Active Apr 14 2012 08:15 PM

Topics I've Started

Loading Textures with SOIL?

10 April 2012 - 10:55 PM

I'm runnning into a goofy texturing issue while trying to implemented this OpenGL tutorial (NeHe Lesson 10), and I've narrowed it down to how I'm loading textures using SOIL. Unfortunately this appeared to be working in previous lessons so I'm kinda lost on what to do.

Any ideas?

http://imgur.com/24gGJ

Should be tiled, not stretched and facing one direction.

texture[0] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp",
						SOIL_LOAD_AUTO,
						SOIL_CREATE_NEW_ID,
						SOIL_FLAG_INVERT_Y );
texture[1] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp",
						SOIL_LOAD_AUTO,
						SOIL_CREATE_NEW_ID,
						SOIL_FLAG_INVERT_Y );
texture[2] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp",
				   SOIL_LOAD_AUTO,
				   SOIL_CREATE_NEW_ID,
				   SOIL_FLAG_INVERT_Y | SOIL_FLAG_MIPMAPS );
		glBindTexture(GL_TEXTURE_2D, texture[0]);
		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
		glBindTexture(GL_TEXTURE_2D, texture[1]);
		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
		glBindTexture(GL_TEXTURE_2D, texture[2]);
		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);

Lesson 10: Texturing issue

09 April 2012 - 11:39 PM

I have a modified (just using classes and a different variable naming scheme) version of Lesson 10 working, but I get this weird texturing issue and the only thing I can think of is it is related to loading in textures using SOIL. I even went as far as modifying the sample code to use SOIL, and I get the same result:

http://imgur.com/24gGJ

Here is my texture loading code, which seemed to work for previous lessons (I've been doing them sequently), debug code stripped out:

texture[0] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp",
			SOIL_LOAD_AUTO,
			SOIL_CREATE_NEW_ID,
			SOIL_FLAG_INVERT_Y );

texture[1] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp",
			SOIL_LOAD_AUTO,
			SOIL_CREATE_NEW_ID,
			SOIL_FLAG_INVERT_Y );

texture[2] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp",
		   SOIL_LOAD_AUTO,
		   SOIL_CREATE_NEW_ID,
		   SOIL_FLAG_INVERT_Y | SOIL_FLAG_MIPMAPS );

	glBindTexture(GL_TEXTURE_2D, texture[0]);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);

	glBindTexture(GL_TEXTURE_2D, texture[1]);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);

	glBindTexture(GL_TEXTURE_2D, texture[2]);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
.


Any idea what is up?

What do I need to include to use timeSetEvent?

16 December 2009 - 06:14 PM

The internet is being unusually not helpful tonight, what headers/libs do I need for timeSetEvent? MSDN is telling me Mmsystem.h and Mmtimer.lib, but it doesn't know where Mmtimer.lib is. Help?

Looping through a std::set and accessing the data?

16 November 2009 - 06:19 PM

I have a std::set, and I want to loop through all the elements and access the data inside. How the heck do I do this? I've tried just doing iterators, but I guess the ++ operator doesn't exist for std::set.... This is confusing.

Help with getting dbghelp.h to compile

14 October 2009 - 04:09 PM

I'm attempting to write a simple minidump project, but I'm getting a tone of errors while compiling with dbghelp.h.
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(61) : error C2146: syntax error : missing ';' before identifier 'ModuleName'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(61) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(61) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(62) : error C2146: syntax error : missing ';' before identifier 'hFile'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(62) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(62) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(63) : error C2146: syntax error : missing ';' before identifier 'MappedAddress'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(63) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(63) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(67) : error C2146: syntax error : missing ';' before identifier 'FileHeader'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(67) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(67) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(69) : error C2146: syntax error : missing ';' before identifier 'LastRvaSection'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(69) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(69) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(70) : error C2146: syntax error : missing ';' before identifier 'NumberOfSections'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(71) : error C2146: syntax error : missing ';' before identifier 'Sections'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(71) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(71) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(72) : error C2146: syntax error : missing ';' before identifier 'Characteristics'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(72) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(72) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(73) : error C2146: syntax error : missing ';' before identifier 'fSystemImage'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(73) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(73) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(74) : error C2146: syntax error : missing ';' before identifier 'fDOSImage'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(74) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(74) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(75) : error C2146: syntax error : missing ';' before identifier 'Links'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(75) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(75) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(76) : error C2146: syntax error : missing ';' before identifier 'SizeOfImage'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(76) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(76) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(83) : error C2146: syntax error : missing ';' before identifier 'DECLSPEC_IMPORT'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(83) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(83) : error C2143: syntax error : missing ';' before '__stdcall'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(83) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(85) : error C2065: 'PSTR' : undeclared identifier
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(85) : error C2146: syntax error : missing ')' before identifier 'FileName'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(85) : warning C4229: anachronism used : modifiers on data are ignored
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(88) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(91) : error C2065: 'CALLBACK' : undeclared identifier
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(91) : error C2065: 'PFIND_DEBUG_FILE_CALLBACK' : undeclared identifier
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(91) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(91) : fatal error C1903: unable to recover from previous error(s); stopping compilation

I'm a little confused on how to fix this. I mean, its trying to compile using dbghelp.h, so it should know where it is (since its packaged with Visual Studios anyways). I'm also using #pragma comment( lib, "dbghelp.lib" ) to make sure that dbghelp.lib is being linked to. Anyone know what the problem is?

PARTNERS