I decided to put all of my ddraw surfaces and related functions into a class. After I had gotten it into the form I wanted I ran into access violations when I tried to aquire a back buffer. I worked with it for a while, checking to see if the window handle was passed to the DDraw object and stuff like that. When this yeilded nothing I took my code that had all DX stuff global, and encased a class around that.
//from this global LPDIRECTDRAW7 lpdd; LPDIRECTDRAWSURFACE7 lpddprimary,lpddback; LPSURFACDESC2 ddsd; void ddraw_init(); void ddraw_dest(); //to this class class screen{ public: LPDIRECTDRAW7 lpdd; LPDIRECTDRAWSURFACE7 lpddprimary,lpddback; LPSURFACDESC2 ddsd; void ddraw_init(); void ddraw_dest(); };
I might of misspelled some data types, but this was just to give you an idea.
Remember that the global code worked perfectly.
So with that modification and an instance in WinMain of screen declared as test, the only changes in my code was from lpddprimary, to test.lpddprimary. With that change brought the same access violations. The Direct draw object is created just fine inside of a class, just not surfaces. <style>a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};
Why is it called a hot water heater? Isn''t it cold when it goes in the tank?
-=CF=-</html>