<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>ALLEGRO_DIRECT3D not defined in this scope</title>
		<link>http://www.allegro.cc/forums/view/611563</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 09 Dec 2012 06:33:06 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I tried using<br /><span class="source-code"><a href="http://www.allegro.cc/manual/al_set_new_display_flags"><span class="a">al_set_new_display_flags</span></a><span class="k2">(</span> ALLEGRO_DIRECT3D <span class="k3">|</span> ALLEGRO_WINDOWED <span class="k3">|</span> ALLEGRO_NOFRAME<span class="k2">)</span><span class="k2">;</span></span><br />as per <a href="https://www.allegro.cc/manual/5/al_set_new_display_flags">this page in the manual,</a> with the MinGW 4.6.2 download, and it says it can&#39;t find ALLEGRO_DIRECT3D.  I tried ALLEGRO_DIRECT3D_INTERNAL, and it seems to work, although Linux accepts it and creates a display regardless.  Perhaps an oversight?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Wed, 05 Dec 2012 00:07:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m pretty sure you need to add this include:</p><p><span class="source-code"><span class="p">#include &lt;allegro5/allegro_direct3d.h&gt;</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Erin Maus)</author>
		<pubDate>Wed, 05 Dec 2012 00:15:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I just tried that (in Linux) and it complains now about </p><pre>/usr/local/include/allegro5/allegro_direct3d.h:20:18: fatal error: d3d9.h: No such file or directory
</pre><p>.  I&#39;m trying to differentiate between which graphic library is in effect without too many #ifdefs.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Wed, 05 Dec 2012 00:18:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It used to be so that you had to include <span class="source-code"><span class="s">"allegro_direct3d.h"</span></span> for the ALLEGRO_DIRECT3D and <span class="source-code"><span class="s">"allegro_opengl.h"</span></span> for ALLEGRO_OPENGL. Then, for some reason, ALLEGRO_OPENGL was moved into the main allegro include, which left ALLEGRO_DIRECT3D inexplicably in its own header.</p><p>EDIT: Incidentally, the reason why those were originally hidden away was to make it a tiny bit harder to write non-portable code. The thinking was that if you used the code in non-platform specific headers you&#39;d automatically get portable code. Now with ALLEGRO_OPENGL being in the non-platform specific header, this is sort of moot...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 05 Dec 2012 00:21:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OTOH, I looked at &lt;allegro5/allegro_direct3d.h&gt; on the Mingw includes and it says
</p><div class="source-code snippet"><div class="inner"><pre><span class="c">/* Display creation flag. */</span>
<span class="p">#define ALLEGRO_DIRECT3D     ALLEGRO_DIRECT3D_INTERNAL</span>
</pre></div></div><p>
which would seem to indicate that Linux should fail to create a display when ALLEGRO_DIRECT3D_INTERNAL was passed to al_set_new_display_flags().  Just a small error, though.<br />[EDIT]<br />On second thought, that&#39;s why it&#39;s labeled &quot;INTERNAL&quot;. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Wed, 05 Dec 2012 00:36:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ALLEGRO_DIRECT3D_INTERNAL is internal though. It&#39;s not documented, and you&#39;re not supposed to use it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 05 Dec 2012 00:43:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Not to mention that D3D is the default, and you shouldn&#39;t need to explicitly specify it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 05 Dec 2012 00:55:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, now I have this (no idea what would happen on OSX or Android)
</p><div class="source-code snippet"><div class="inner"><pre>  active_gl <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_display_flags"><span class="a">al_get_display_flags</span></a><span class="k2">(</span>display<span class="k2">)</span> <span class="k3">&amp;</span> ALLEGRO_OPENGL<span class="k2">;</span>
  <span class="k1">if</span><span class="k2">(</span>active_gl <span class="k3">&amp;</span> ALLEGRO_OPENGL<span class="k2">)</span>
  <span class="k2">{</span>
    zz_draw_focus <span class="k3">=</span> <span class="k3">&amp;</span>zz_draw_ogl_focus<span class="k2">;</span>
  <span class="k2">}</span>
  <span class="k1">else</span>  <span class="c">//fall through to direct3d</span>
  <span class="k2">{</span>
    zz_draw_focus <span class="k3">=</span> <span class="k3">&amp;</span>zz_draw_d3d_focus<span class="k2">;</span>
  <span class="k2">}</span>
</pre></div></div><p>
I&#39;ll probably replace it with some private defines instead of putting the code directly in there.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Wed, 05 Dec 2012 01:15:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Everything but Windows is GL. That is a decent way of doing it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 05 Dec 2012 01:40:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ALLEGRO_OPENGL always was public. And using Allegro to write a (platform-independent) OpenGL game is one of the use cases, it makes a lot of sense to do, including under Windows.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Wed, 05 Dec 2012 21:39:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611563/971606#target">Elias</a> said:</div><div class="quote"><p> ALLEGRO_OPENGL always was public.</p></div></div><p>No, it wasn&#39;t:</p><pre class="terminal scroll">git diff -r 17ccbaa{^,} -- include/allegro5/display_new.h
diff --git a/include/allegro5/display_new.h b/include/allegro5/display_new.h
index ee111c9..8302dc9 100644
--- a/include/allegro5/display_new.h
+++ b/include/allegro5/display_new.h
@@ -12,21 +12,20 @@
 #endif
 
 /* Possible bit combinations for the flags parameter of al_create_display. */
-
-#define ALLEGRO_WINDOWED     1
-#define ALLEGRO_FULLSCREEN   2
-// moved to allegro_opengl.h
-//#define ALLEGRO_OPENGL       4
-// moved to allegro_direct3d.h
-//#define ALLEGRO_DIRECT3D     8
-#define ALLEGRO_RESIZABLE    16
-//#define ALLEGRO_SINGLEBUFFER 32
-#define ALLEGRO_NOFRAME      64
-#define ALLEGRO_GENERATE_EXPOSE_EVENTS 128
-//is something using 256? didn&#39;t seem to work...
-#define ALLEGRO_FULLSCREEN_WINDOW 512
+enum {
+   ALLEGRO_WINDOWED                    = 1 &lt;&lt; 0,
+   ALLEGRO_FULLSCREEN                  = 1 &lt;&lt; 1,
+   ALLEGRO_OPENGL                      = 1 &lt;&lt; 2,
+   ALLEGRO_DIRECT3D_INTERNAL           = 1 &lt;&lt; 3,
+   ALLEGRO_RESIZABLE                   = 1 &lt;&lt; 4,
+   ALLEGRO_NOFRAME                     = 1 &lt;&lt; 5,
+   ALLEGRO_GENERATE_EXPOSE_EVENTS      = 1 &lt;&lt; 6,
+   ALLEGRO_OPENGL_3_0                  = 1 &lt;&lt; 7,
+   ALLEGRO_OPENGL_FORWARD_COMPATIBLE   = 1 &lt;&lt; 8,
+   ALLEGRO_FULLSCREEN_WINDOW           = 1 &lt;&lt; 9,
 /* This is set to mark a display used only internally. */
-#define ALLEGRO_INTERNAL 1024
+   ALLEGRO_INTERNAL                    = 1 &lt;&lt; 10
+};
 
 /* Possible parameters for al_set_display_option.
  * Make sure to update ALLEGRO_EXTRA_DISPLAY_SETTINGS if you modify</pre><p>
</p><pre class="terminal">git show 17ccbaa
commit 17ccbaa2b3e7c4230971495c5e10e531c1bc4679
Author: Elias Pschernig &lt;elias@users.sourceforge.net&gt;
Date:   Sun Apr 4 20:58:11 2010 +0000

    Fixed display flags which were in various #defines across several headers.</pre><p>
</p><pre class="terminal scroll">git diff -r 2f8d56{^,} -- include/allegro5/display_new.h
diff --git a/include/allegro5/display_new.h b/include/allegro5/display_new.h
index 55550cc..7617c6a 100644
--- a/include/allegro5/display_new.h
+++ b/include/allegro5/display_new.h
@@ -15,7 +15,8 @@
 
 #define ALLEGRO_WINDOWED     1
 #define ALLEGRO_FULLSCREEN   2
-#define ALLEGRO_OPENGL       4
+// moved to a5_opengl.h
+//#define ALLEGRO_OPENGL       4
 #define ALLEGRO_DIRECT3D     8
 //#define ALLEGRO_GENERATE_UPDATE_EVENTS 64
 #define ALLEGRO_RESIZABLE    16</pre><p>
</p><pre class="terminal">git show 2f8d56
commit 2f8d565525fef076a31494dd71ef0b4b0884709c
Author: Milan Mimica &lt;mmimica@users.sourceforge.net&gt;
Date:   Sun Oct 12 11:23:08 2008 +0000

    To prevent namespce pollution, and accidental usage of OpenGL-specific
    functions, programs using OpenGL must include allegro5/a5_opengl.h from
    now on.</pre><p>

</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> And using Allegro to write a (platform-independent) OpenGL game is one of the use cases, it makes a lot of sense to do, including under Windows.</p></div></div><p>Pretty sure Allegro can be compiled without OpenGL support on Windows.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 05 Dec 2012 22:04:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Having ALLEGRO_OPENGL in the &quot;default&quot; headers while ALLEGRO_DIRECT3D needs to have allegro_direct3d.h included is a bit irritating. To have no problems with that I wrote some lines to work around this problem.</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number"> 1</span><span class="p">#ifdef ALLEGRO_WINDOWS</span>
<span class="number"> 2</span><span class="p">#include &lt;allegro5/allegro_direct3d.h&gt;</span>
<span class="number"> 3</span><span class="p">#else</span>
<span class="number"> 4</span><span class="p">#define ALLEGRO_DIRECT3D 0 /* dummy define for non Win systems */</span>
<span class="number"> 5</span><span class="p">#endif /* ALLEGRO_WINDOWS */</span>
</div></div><p>

This helps me having D3D on Unix systems, too. (In my project the user can choose the renderer if he wants to).8-)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Sebastian Steinhauer)</author>
		<pubDate>Sun, 09 Dec 2012 06:12:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Please don&#39;t do that. At worst, alias ALLEGRO_DIRECT3D to ALLEGRO_DIRECT3D_INTERNAL.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sun, 09 Dec 2012 06:30:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Or don&#39;t include the D3D stuff on systems that don&#39;t have D3D... Doesn&#39;t really make sense to provide the user an option to select between D3D and OpenGL on linux for example.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 09 Dec 2012 06:33:06 +0000</pubDate>
	</item>
</rss>
