<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Single-Call OpenGL Texture Loader in DevIL</title>
	<atom:link href="http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/feed/" rel="self" type="application/rss+xml" />
	<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=single-call-opengl-texture-loader-in-devil</link>
	<description>A number-pimping side project from the valleys in *NEW* upside-down flavour.</description>
	<lastBuildDate>Tue, 15 May 2012 23:01:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Annette</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-7479</link>
		<dc:creator>Annette</dc:creator>
		<pubDate>Wed, 15 Feb 2012 20:25:54 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-7479</guid>
		<description>It worked. Once I worked on the texture coordinates, I was able to load the image. Thank you</description>
		<content:encoded><![CDATA[<p>It worked. Once I worked on the texture coordinates, I was able to load the image. Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-7443</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Thu, 02 Feb 2012 23:38:44 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-7443</guid>
		<description>Hi Annette,

You weren&#039;t specifying texture co-ordinates as well as vertex co-ords, so it&#039;ll work to draw colours, but not textures (where the co-ordinates are normalised to the range 0.0 -&gt; 1.0).

I&#039;d recommend getting a copy of the 4th edition of the &lt;a href=&quot;http://www.opengl.org/sdk/docs/books/SuperBible/&quot;&gt;OpenGL Superbible&lt;/a&gt; to help you along with this OpenGL lark (the 5th edition is pure shaders from the word go - so if you&#039;re ready to make that jump by all means snag a copy of the 5th edition and go for it) - it&#039;s a great book and it helped me tons when I was starting off.

Anyways, here&#039;s some code which draws textured arcs and circles to get you started:
- &lt;a href=&quot;http://r3dux.org/files/code/OpenGLTextureTest/TextureFace.cpp&quot;&gt;TextureFace.cpp&lt;/a&gt; (Windows line endings)
- &lt;a href=&quot;http://r3dux.org/files/code/OpenGLTextureTest/5-TextureFace.zip&quot;&gt;5-TextureFace.zip&lt;/a&gt; (Code::Blocks project w/ textures)

Which when run produces this monstrocity, but you get the idea... ;)

&lt;div align=&quot;center&quot;&gt;&lt;img src=&quot;http://r3dux.org/files/code/OpenGLTextureTest/MoonFace.jpg&quot; alt=&quot;OpenGL Moon Face!&quot; /&gt;&lt;/div&gt;

Regards,
r3dux</description>
		<content:encoded><![CDATA[<p>Hi Annette,</p>
<p>You weren&#8217;t specifying texture co-ordinates as well as vertex co-ords, so it&#8217;ll work to draw colours, but not textures (where the co-ordinates are normalised to the range 0.0 -> 1.0).</p>
<p>I&#8217;d recommend getting a copy of the 4th edition of the <a href="http://www.opengl.org/sdk/docs/books/SuperBible/">OpenGL Superbible</a> to help you along with this OpenGL lark (the 5th edition is pure shaders from the word go &#8211; so if you&#8217;re ready to make that jump by all means snag a copy of the 5th edition and go for it) &#8211; it&#8217;s a great book and it helped me tons when I was starting off.</p>
<p>Anyways, here&#8217;s some code which draws textured arcs and circles to get you started:<br />
- <a href="http://r3dux.org/files/code/OpenGLTextureTest/TextureFace.cpp">TextureFace.cpp</a> (Windows line endings)<br />
- <a href="http://r3dux.org/files/code/OpenGLTextureTest/5-TextureFace.zip">5-TextureFace.zip</a> (Code::Blocks project w/ textures)</p>
<p>Which when run produces this monstrocity, but you get the idea&#8230; <img src='http://r3dux.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div align="center"><img src="http://r3dux.org/files/code/OpenGLTextureTest/MoonFace.jpg" alt="OpenGL Moon Face!" /></div>
<p>Regards,<br />
r3dux</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Annette</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-7441</link>
		<dc:creator>Annette</dc:creator>
		<pubDate>Thu, 02 Feb 2012 15:26:57 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-7441</guid>
		<description>The image is still not uploading.  This is how my display function looks:

&lt;pre lang=&quot;cpp&quot;&gt;void display(void)
{

    //clear the screen
   glClear(GL_COLOR_BUFFER_BIT &#124; GL_DEPTH_BUFFER_BIT);
  

     glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();
     glRotatef(Angle, 0.0, 0.0, 0.0);

    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); 
    
   	// Select the texture to use
    glBindTexture(GL_TEXTURE_2D, texture[0]);
    
    
	// Draw our texture
	glEnable(GL_TEXTURE_2D);
	
    //Nose
   drawTriangle();

   //Face
   circle (250, 250, 400);
   
   
   //Inner Eyes
   glLoadIdentity();
   circle(200, 280, 10);
   drawCircle1(-30, 280, 10);
   
   //Eye lids
   glLoadIdentity();
   glScalef(0.6,0.2,0);
   circle(530, 2400, 60);
   circle(-150, 2150, 60);
   
   //Arc for eyebrows
   drawArc(500, 500, -70, -140, 100);
   drawArc(270, 500, -70, -140, 100);
   
   //Mouth
   drawArc(380, 250, 110, -180, 180);
  // drawArc(380, 100, -100, -180, 180);

   drawLine();
   
   	glDisable(GL_TEXTURE_2D);

	// ----- Stop Drawing Stuff! ------

	glfwSwapBuffers(); // Swap the buffers to display the scene (so we don&#039;t have to watch it being drawn!)

}

An example of the circle function which is called in the display function is:

void circle(GLint x, GLint y, GLint radius)
{
	float angle;
    
    glTranslatef(300, 100, 0.0);
	glTranslatef(0.0,150.0, 1.0);

	glColor3f(0.0f, 1.0f, 0.0f);
	glBegin(GL_LINE_LOOP);
	for (int i = 0; i &lt; 100; i++)
	{
		angle = i*2*PI/100;
		float X = x + (cos(angle) * radius);
		float Y = y + (sin(angle) * radius);
		glVertex2f(X, Y);
		//glVertex2f(x + (cos(angle) * radius), y + (sin(angle) * radius));
	}
	glEnd();

}&lt;/pre&gt;

I don&#039;t think it should be a problem calling a function from the display function</description>
		<content:encoded><![CDATA[<p>The image is still not uploading.  This is how my display function looks:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> display<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
&nbsp;
    <span style="color: #666666;">//clear the screen</span>
   glClear<span style="color: #008000;">&#40;</span>GL_COLOR_BUFFER_BIT <span style="color: #000040;">|</span> GL_DEPTH_BUFFER_BIT<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
&nbsp;
     glMatrixMode<span style="color: #008000;">&#40;</span>GL_MODELVIEW<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
     glLoadIdentity<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
     glRotatef<span style="color: #008000;">&#40;</span>Angle, <span style="color:#800080;">0.0</span>, <span style="color:#800080;">0.0</span>, <span style="color:#800080;">0.0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    glTexEnvf<span style="color: #008000;">&#40;</span>GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> 
&nbsp;
   	<span style="color: #666666;">// Select the texture to use</span>
    glBindTexture<span style="color: #008000;">&#40;</span>GL_TEXTURE_2D, texture<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
&nbsp;
	<span style="color: #666666;">// Draw our texture</span>
	glEnable<span style="color: #008000;">&#40;</span>GL_TEXTURE_2D<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #666666;">//Nose</span>
   drawTriangle<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//Face</span>
   circle <span style="color: #008000;">&#40;</span><span style="color: #0000dd;">250</span>, <span style="color: #0000dd;">250</span>, <span style="color: #0000dd;">400</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
&nbsp;
   <span style="color: #666666;">//Inner Eyes</span>
   glLoadIdentity<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
   circle<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">200</span>, <span style="color: #0000dd;">280</span>, <span style="color: #0000dd;">10</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
   drawCircle1<span style="color: #008000;">&#40;</span><span style="color: #000040;">-</span><span style="color: #0000dd;">30</span>, <span style="color: #0000dd;">280</span>, <span style="color: #0000dd;">10</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//Eye lids</span>
   glLoadIdentity<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
   glScalef<span style="color: #008000;">&#40;</span><span style="color:#800080;">0.6</span>,<span style="color:#800080;">0.2</span>,<span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
   circle<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">530</span>, <span style="color: #0000dd;">2400</span>, <span style="color: #0000dd;">60</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
   circle<span style="color: #008000;">&#40;</span><span style="color: #000040;">-</span><span style="color: #0000dd;">150</span>, <span style="color: #0000dd;">2150</span>, <span style="color: #0000dd;">60</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//Arc for eyebrows</span>
   drawArc<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">500</span>, <span style="color: #0000dd;">500</span>, <span style="color: #000040;">-</span><span style="color: #0000dd;">70</span>, <span style="color: #000040;">-</span><span style="color: #0000dd;">140</span>, <span style="color: #0000dd;">100</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
   drawArc<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">270</span>, <span style="color: #0000dd;">500</span>, <span style="color: #000040;">-</span><span style="color: #0000dd;">70</span>, <span style="color: #000040;">-</span><span style="color: #0000dd;">140</span>, <span style="color: #0000dd;">100</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//Mouth</span>
   drawArc<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">380</span>, <span style="color: #0000dd;">250</span>, <span style="color: #0000dd;">110</span>, <span style="color: #000040;">-</span><span style="color: #0000dd;">180</span>, <span style="color: #0000dd;">180</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  <span style="color: #666666;">// drawArc(380, 100, -100, -180, 180);</span>
&nbsp;
   drawLine<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   	glDisable<span style="color: #008000;">&#40;</span>GL_TEXTURE_2D<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #666666;">// ----- Stop Drawing Stuff! ------</span>
&nbsp;
	glfwSwapBuffers<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Swap the buffers to display the scene (so we don't have to watch it being drawn!)</span>
&nbsp;
<span style="color: #008000;">&#125;</span>
&nbsp;
An example of the circle function which is called in the display function is<span style="color: #008080;">:</span>
&nbsp;
<span style="color: #0000ff;">void</span> circle<span style="color: #008000;">&#40;</span>GLint x, GLint y, GLint radius<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">float</span> angle<span style="color: #008080;">;</span>
&nbsp;
    glTranslatef<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">300</span>, <span style="color: #0000dd;">100</span>, <span style="color:#800080;">0.0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	glTranslatef<span style="color: #008000;">&#40;</span><span style="color:#800080;">0.0</span>,<span style="color:#800080;">150.0</span>, <span style="color:#800080;">1.0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	glColor3f<span style="color: #008000;">&#40;</span><span style="color:#800080;">0.0f</span>, <span style="color:#800080;">1.0f</span>, <span style="color:#800080;">0.0f</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	glBegin<span style="color: #008000;">&#40;</span>GL_LINE_LOOP<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> <span style="color: #0000dd;">100</span><span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		angle <span style="color: #000080;">=</span> i<span style="color: #000040;">*</span><span style="color: #0000dd;">2</span><span style="color: #000040;">*</span>PI<span style="color: #000040;">/</span><span style="color: #0000dd;">100</span><span style="color: #008080;">;</span>
		<span style="color: #0000ff;">float</span> X <span style="color: #000080;">=</span> x <span style="color: #000040;">+</span> <span style="color: #008000;">&#40;</span><span style="color: #0000dd;">cos</span><span style="color: #008000;">&#40;</span>angle<span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> radius<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		<span style="color: #0000ff;">float</span> Y <span style="color: #000080;">=</span> y <span style="color: #000040;">+</span> <span style="color: #008000;">&#40;</span><span style="color: #0000dd;">sin</span><span style="color: #008000;">&#40;</span>angle<span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> radius<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		glVertex2f<span style="color: #008000;">&#40;</span>X, Y<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		<span style="color: #666666;">//glVertex2f(x + (cos(angle) * radius), y + (sin(angle) * radius));</span>
	<span style="color: #008000;">&#125;</span>
	glEnd<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>I don&#8217;t think it should be a problem calling a function from the display function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Annette</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-7440</link>
		<dc:creator>Annette</dc:creator>
		<pubDate>Thu, 02 Feb 2012 14:25:29 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-7440</guid>
		<description>I&#039;ll give it a try and let you know how it goes.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll give it a try and let you know how it goes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-7436</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Wed, 01 Feb 2012 22:15:42 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-7436</guid>
		<description>OpenGL black-screen problems are notorious for being a pain to troubleshoot as they could be caused by lots of things. The first things I&#039;d check would be if you&#039;re binding to your texture before doing the drawing, and that your polygon-winding is anti-clockwise (i.e. front-facing by default, although you can change the winding order if desired).

Oh, and be aware that any colour settings you have specified can affect how the textured polygon is drawn, so you might want to call &lt;strong&gt;glcolor4f(1.0f, 1.0f, 1.0f, 1.0f);&lt;/strong&gt; before drawing anything.

The cut-down version of my &quot;display()&quot; function has this:

&lt;pre lang=&quot;cpp&quot;&gt;
glClear(GL_COLOR_BUFFER_BIT &#124; GL_DEPTH_BUFFER_BIT); // Clear the screen and depth buffer

// Reset the matrix to identity
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glTranslatef(0.0f, 0.0f, -40.0f); // Move things back into the screen

glBindTexture(GL_TEXTURE_2D, textureHandle); // Select the texture to use and bind to it

static float hsize = 15.0f; // Vertical size of the quad
static float vsize = 10.0f; // Vertical size of the quad

glEnable(GL_TEXTURE_2D);

// Draw our textured geometry (just a rectangle in this instance)
glBegin(GL_QUADS);                         // Anti-clockwise winding = front facing
	glTexCoord2f(0.0, 0.0);
	glVertex3f(-hsize, -vsize, 0.0f);  // Top left
	glTexCoord2f(0.0, 1.0);
	glVertex3f(-hsize,  vsize, 0.0f);  // Bottom left
	glTexCoord2f(1.0, 1.0);
	glVertex3f(hsize,   vsize, 0.0f);  // Bottom right
	glTexCoord2f(1.0, 0.0);
	glVertex3f(hsize,  -vsize, 0.0f);  // Top right
glEnd();

glDisable(GL_TEXTURE_2D);

// ----- Stop Drawing Stuff! ------

glfwSwapBuffers();&lt;/pre&gt;

I&#039;ve posted up the full, working version for you here: &lt;a href=&quot;http://r3dux.org/files/code/OpenGLTextureTest/OpenGLTextureTest.cpp&quot;&gt;OpenGLTextureTest.cpp&lt;/a&gt; - hope it helps.</description>
		<content:encoded><![CDATA[<p>OpenGL black-screen problems are notorious for being a pain to troubleshoot as they could be caused by lots of things. The first things I&#8217;d check would be if you&#8217;re binding to your texture before doing the drawing, and that your polygon-winding is anti-clockwise (i.e. front-facing by default, although you can change the winding order if desired).</p>
<p>Oh, and be aware that any colour settings you have specified can affect how the textured polygon is drawn, so you might want to call <strong>glcolor4f(1.0f, 1.0f, 1.0f, 1.0f);</strong> before drawing anything.</p>
<p>The cut-down version of my &#8220;display()&#8221; function has this:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">glClear<span style="color: #008000;">&#40;</span>GL_COLOR_BUFFER_BIT <span style="color: #000040;">|</span> GL_DEPTH_BUFFER_BIT<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Clear the screen and depth buffer</span>
&nbsp;
<span style="color: #666666;">// Reset the matrix to identity</span>
glMatrixMode<span style="color: #008000;">&#40;</span>GL_MODELVIEW<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
glLoadIdentity<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
glTranslatef<span style="color: #008000;">&#40;</span><span style="color:#800080;">0.0f</span>, <span style="color:#800080;">0.0f</span>, <span style="color: #000040;">-</span><span style="color:#800080;">40.0f</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Move things back into the screen</span>
&nbsp;
glBindTexture<span style="color: #008000;">&#40;</span>GL_TEXTURE_2D, textureHandle<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Select the texture to use and bind to it</span>
&nbsp;
<span style="color: #0000ff;">static</span> <span style="color: #0000ff;">float</span> hsize <span style="color: #000080;">=</span> <span style="color:#800080;">15.0f</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Vertical size of the quad</span>
<span style="color: #0000ff;">static</span> <span style="color: #0000ff;">float</span> vsize <span style="color: #000080;">=</span> <span style="color:#800080;">10.0f</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Vertical size of the quad</span>
&nbsp;
glEnable<span style="color: #008000;">&#40;</span>GL_TEXTURE_2D<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// Draw our textured geometry (just a rectangle in this instance)</span>
glBegin<span style="color: #008000;">&#40;</span>GL_QUADS<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>                         <span style="color: #666666;">// Anti-clockwise winding = front facing</span>
	glTexCoord2f<span style="color: #008000;">&#40;</span><span style="color:#800080;">0.0</span>, <span style="color:#800080;">0.0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	glVertex3f<span style="color: #008000;">&#40;</span><span style="color: #000040;">-</span>hsize, <span style="color: #000040;">-</span>vsize, <span style="color:#800080;">0.0f</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>  <span style="color: #666666;">// Top left</span>
	glTexCoord2f<span style="color: #008000;">&#40;</span><span style="color:#800080;">0.0</span>, <span style="color:#800080;">1.0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	glVertex3f<span style="color: #008000;">&#40;</span><span style="color: #000040;">-</span>hsize,  vsize, <span style="color:#800080;">0.0f</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>  <span style="color: #666666;">// Bottom left</span>
	glTexCoord2f<span style="color: #008000;">&#40;</span><span style="color:#800080;">1.0</span>, <span style="color:#800080;">1.0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	glVertex3f<span style="color: #008000;">&#40;</span>hsize,   vsize, <span style="color:#800080;">0.0f</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>  <span style="color: #666666;">// Bottom right</span>
	glTexCoord2f<span style="color: #008000;">&#40;</span><span style="color:#800080;">1.0</span>, <span style="color:#800080;">0.0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	glVertex3f<span style="color: #008000;">&#40;</span>hsize,  <span style="color: #000040;">-</span>vsize, <span style="color:#800080;">0.0f</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>  <span style="color: #666666;">// Top right</span>
glEnd<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
glDisable<span style="color: #008000;">&#40;</span>GL_TEXTURE_2D<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// ----- Stop Drawing Stuff! ------</span>
&nbsp;
glfwSwapBuffers<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>I&#8217;ve posted up the full, working version for you here: <a href="http://r3dux.org/files/code/OpenGLTextureTest/OpenGLTextureTest.cpp">OpenGLTextureTest.cpp</a> &#8211; hope it helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Annette</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-7434</link>
		<dc:creator>Annette</dc:creator>
		<pubDate>Wed, 01 Feb 2012 18:00:49 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-7434</guid>
		<description>I have another question. The image I am uploading is not showing. I think the problem is with the &quot;drawScene()&quot; in the main function. I changed mine to &quot;display()&quot; because that was where I have the functions to the textures I drew. I drew a circle, triangle, etc, in different functions and I put all the functions in &quot;display()&quot;. So where you have &quot;drawScene()&quot;, I have &quot;display()&quot; there. But I don&#039;t see the image. Could that be the problem or it might be something else? When I take you code out of my program, I can see the shapes but when I include yours and try to upload it, nothing comes up.

// Load an image and bind it to a texture
	texture[0] = loadImage(imageName);

	while (running == true)
	{
		// Draw our scene
		drawScene();

		// exit if ESC was pressed or window was closed
        	running = !glfwGetKey(GLFW_KEY_ESC) &amp;&amp; glfwGetWindowParam( GLFW_OPENED);
	}

	glfwTerminate();

	return 0;</description>
		<content:encoded><![CDATA[<p>I have another question. The image I am uploading is not showing. I think the problem is with the &#8220;drawScene()&#8221; in the main function. I changed mine to &#8220;display()&#8221; because that was where I have the functions to the textures I drew. I drew a circle, triangle, etc, in different functions and I put all the functions in &#8220;display()&#8221;. So where you have &#8220;drawScene()&#8221;, I have &#8220;display()&#8221; there. But I don&#8217;t see the image. Could that be the problem or it might be something else? When I take you code out of my program, I can see the shapes but when I include yours and try to upload it, nothing comes up.</p>
<p>// Load an image and bind it to a texture<br />
	texture[0] = loadImage(imageName);</p>
<p>	while (running == true)<br />
	{<br />
		// Draw our scene<br />
		drawScene();</p>
<p>		// exit if ESC was pressed or window was closed<br />
        	running = !glfwGetKey(GLFW_KEY_ESC) &amp;&amp; glfwGetWindowParam( GLFW_OPENED);<br />
	}</p>
<p>	glfwTerminate();</p>
<p>	return 0;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Annette</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-7433</link>
		<dc:creator>Annette</dc:creator>
		<pubDate>Wed, 01 Feb 2012 17:51:08 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-7433</guid>
		<description>Yes, I did. But I finally solved it. Just to let you know, I incorporated your code into mine. The program is compiling now.I went to Devpak.org and downloaded DevIL.  Then I opened my program in Dev-C++ and went to Tool-&gt;Package Manager-&gt; and clicked on install. I followed the Wizard directions. It asked me to upload the package I had just downloaded. Once the installation was complete, DevIL was added to the packages in package manager. That&#039;s all I had to do. To verify that all the libraries were on my machine, I went to C:\Dev-cpp\lib

I saw all the ilu and ilut libraries: the object libraries and those ending in .a. I think the files ending in .a were the ones the compiler was looking for, and not the object library files. Now the program is compiling and all the errors went away.</description>
		<content:encoded><![CDATA[<p>Yes, I did. But I finally solved it. Just to let you know, I incorporated your code into mine. The program is compiling now.I went to Devpak.org and downloaded DevIL.  Then I opened my program in Dev-C++ and went to Tool-&gt;Package Manager-&gt; and clicked on install. I followed the Wizard directions. It asked me to upload the package I had just downloaded. Once the installation was complete, DevIL was added to the packages in package manager. That&#8217;s all I had to do. To verify that all the libraries were on my machine, I went to C:\Dev-cpp\lib</p>
<p>I saw all the ilu and ilut libraries: the object libraries and those ending in .a. I think the files ending in .a were the ones the compiler was looking for, and not the object library files. Now the program is compiling and all the errors went away.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-7432</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Tue, 31 Jan 2012 22:30:24 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-7432</guid>
		<description>Did you check &lt;a href=&quot;http://r3dux.org/2011/09/simple-texture-loading-with-devil-revisited/&quot;&gt;simple-texture-loading-with-devil-revisited&lt;/a&gt;? It step-by-steps &lt;em&gt;everything&lt;/em&gt; you need to do to get a texture from an image via the DevIL library.</description>
		<content:encoded><![CDATA[<p>Did you check <a href="http://r3dux.org/2011/09/simple-texture-loading-with-devil-revisited/">simple-texture-loading-with-devil-revisited</a>? It step-by-steps <em>everything</em> you need to do to get a texture from an image via the DevIL library.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Annette</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-7426</link>
		<dc:creator>Annette</dc:creator>
		<pubDate>Tue, 31 Jan 2012 15:33:42 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-7426</guid>
		<description>How were you able to solve this problem? I am having a similar problem.</description>
		<content:encoded><![CDATA[<p>How were you able to solve this problem? I am having a similar problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/#comment-6999</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Wed, 05 Oct 2011 12:11:34 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3616#comment-6999</guid>
		<description>Hi Florian,

You can use the code without issue for any purpose - I wrote and posted it in the hope it&#039;d be useful to someone! And as DevIL itself is released under the &lt;a href=&quot;http://openil.sourceforge.net/license.php&quot; rel=&quot;nofollow&quot;&gt;LGPL&lt;/a&gt;, there&#039;s no issue in using it for commercial works.

You don&#039;t have to give me a mention in the credits, but it would be nice if my code&#039;s helped you at all =D

Best of luck with your production!</description>
		<content:encoded><![CDATA[<p>Hi Florian,</p>
<p>You can use the code without issue for any purpose &#8211; I wrote and posted it in the hope it&#8217;d be useful to someone! And as DevIL itself is released under the <a href="http://openil.sourceforge.net/license.php">LGPL</a>, there&#8217;s no issue in using it for commercial works.</p>
<p>You don&#8217;t have to give me a mention in the credits, but it would be nice if my code&#8217;s helped you at all =D</p>
<p>Best of luck with your production!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

