Thomas Hruska wrote:
>
> Christopher Coale wrote:
> > Thomas Hruska wrote:
> >> Michael Sullivan wrote:
> >>> I have been trying (futilly I might add) to learn DirectX. I thought
> >> I was
> >>> making progress today, but I can't figure this out. I have four
> >> images that
> >>> I want to draw on the back buffer. I know that they should be used as
> >>> sprites, but right now I just want to display them to the back
> buffer. I
> >>> have successfully displayed one to the back buffer, but when I
> >> altered the
> >>> code to dsplay the others too I started getting Access Violations.
> >> What is
> >>> an access violation anyway? I've been searching the internet all day
> >> trying
> >>> to find a simple definition of what causes it, but all I've found
> >> were very
> >>> specific cases. The code compiles and links correctly:
> >> While I've not used any portion of DirectX, I do know it is heavily
> >> steeped in COM. Which isn't really "direct" by any stretch of the
> >> imagination.
> >>
> >> You should first find something simpler to work with that involves COM
> >> to get a feel for how that bit of technology works. Diving right into
> >> DirectX is asking for a double-whammy. DirectX is fairly fragile from
> >> my perspective as a gamer AND developer. While I've not written
> >> anything myself, I've helped debug several applications that did use it
> >> - crashes within DirectX typically smash the stack and render the
> >> debugger useless. The problems ultimately stem from the abuse of COM
> >> for something it shouldn't be used for (high-performance 3D
> >> applications). Make sure you are creating objects and destroying them
> >> properly. Then make sure you aren't overstepping array boundaries
> >> anywhere.
> >>
> >> --
> >> Thomas Hruska
> >> CubicleSoft President
> >> Ph: 517-803-4197
> >>
> >> *NEW* MyTaskFocus 1.1
> >> Get on task. Stay on task.
> >>
> >> http://www.CubicleSoft.com/MyTaskFocus/
> <http://www.CubicleSoft.com/MyTaskFocus/>
> >> <http://www.CubicleSoft.com/MyTaskFocus/
> <http://www.CubicleSoft.com/MyTaskFocus/>>
> >>
> >>
> > COM has nothing to do with his problem. And, since Direct3D has a C++
> > library that wraps around COM, a person really doesn't need that much
> > knowledge about COM in order to use Direct3D properly. All Direct3D
> > resource classes inherit a Release method, that, for any game
> developer,
> > is common sense to call when you are done with the resource. Direct3D
> > isn't any more "fragile" than a basic Windows application.
> >
> > "The problems ultimately stem from the abuse of COM for something it
> > shouldn't be used for (high-performance 3D applications)."
> >
> > What problems? This problem is simply because the programmer is
> > accessing memory that doesn't belong to him or hasn't been allocated
> > properly. That is likely to happen in any program. There really is no
> > problem with Direct3D being COM based. Obviously, if Direct3D being
> > based on COM was a problem, every game developer would switch to OpenGL
> > (which just happens to be much slower than Direct3D, and doesn't use
> COM.)
> >
> > Just my two cents. ;)
>
> I'll just open my mouth and insert foot :)
>
> It still wouldn't hurt to understand COM prior to using DirectX.
>
> Setting the DirectX discussion aside for the moment, let me take this
> moment to suggest to the OP: libsdl. Under Windows, it uses DirectX.
> Elsewhere it uses OpenGL. One library = multiple platforms. Several
> people here have used it.
>
> --
> Thomas Hruska
> CubicleSoft President
> Ph: 517-803-4197
>
> *NEW* MyTaskFocus 1.1
> Get on task. Stay on task.
>
> http://www.CubicleSoft.com/MyTaskFocus/
> <http://www.CubicleSoft.com/MyTaskFocus/>
>
>
SDL does not have support for Direct3D, it uses DirectDraw which has no
support for 3D hardware acceleration. (Letting the GPU draw a 3D-scene
as a 2D-scene is most-likely going to be faster than making the CPU draw
a 2D-scene without any hardware acceleration.)
I recommend he stays with Direct3D as it is a very widely accepted and
up-to-date SDK (used by just about every professional game development
company), and Microsoft actually works closely with graphics card
companies (nVidia, ATI, etc.) to get the best results. On top of that,
if he is trying to learn game development/programming, Direct3D will
teach him the fundamentals (shader programming, math, etc.). If he all
ready knows what actually goes on behind the scenes, and he is just
playing around with graphics programming, then SDL would be fine.