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/> >> >> > 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/
