Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


why do my DX8 apps crash in win 98?

This topic is 6025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

They work fine on my computer running me, and a couple of freind's who run xp, but if i try to run on on a win98 machine, it changes the resolution, turns the screen black and crashes with an acces violation or somthing, anyone have any idea why? Edited by - anewbie123 on January 14, 2002 4:44:22 PM

Share this post

Link to post
Share on other sites
This may help somewhat. I recently compiled a tutorial from drunkenhyena.com (Tutorial Lesson 1).

Compiled on Win2k, runs fine on Win2k.
Breaks on Win98.

It breaks here:

hr=g_D3D->CreateDevice(D3DADAPTER_DEFAULT, //The default adapter, on a multimonitor system

//there can be more than one.

//Use hardware acceleration rather than the software renderer

//Our Window

//Process vertices in software. This is slower than in hardware,

//But will work on all graphics cards.

//Our D3DPRESENT_PARAMETERS structure, so it knows what we want to build

//This will be set to point to the new device


Share this post

Link to post
Share on other sites
What values are you passing inside the D3DPRESENT_PARAMETERS structure? I know some of the values don''t work well with each other, and win2k might accommodate something that win98 is more strict with. Just a guess, though...

Share this post

Link to post
Share on other sites
hDeviceWindow = Main_Window_Handle
BackBufferCount= 1
EnableAutoDepthStencil = TRUE
AutoDepthStencilFormat = D3DFMT_D16
Windowed = FALSE
BackBufferWidth = 800
BackBufferHeight = 600
BackBufferFormat = D3DFMT_R5G6B5

those are the settings, see any conflicts?

Share this post

Link to post
Share on other sites
I don''t see any conflicts in the struct. Right now the only thing I think it might be is that the video card does not support that video format, or windows 98 sucks. Seriously though, I''m stumped. I haven''t tried programming using D3D for 3D yet, but the following struct works for 2D D3D apps in win98 (confusing). I hope that helps somehow.

PresentParameters.BackBufferWidth = 1024;
PresentParameters.BackBufferHeight = 768;
PresentParameters.BackBufferFormat = D3DFMT_A8R8G8B8;
PresentParameters.BackBufferCount = 1;
PresentParameters.MultiSampleType = D3DMULTISAMPLE_NONE;
PresentParameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
PresentParameters.hDeviceWindow = MainWindow;
PresentParameters.Windowed = false;
PresentParameters.EnableAutoDepthStencil = false;
PresentParameters.Flags = 0;
PresentParameters.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
PresentParameters.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
In the doc (see CreateDevice) it says that "This method should not be executed during the handling of WM_CREATE". Further, that "a call to create, release, or reset the device can only happen on the same thread as the window procedure of the focus window". Did you take these in consideration?

Share this post

Link to post
Share on other sites
Here is the parameter setting. It fails in Win98 in both windowed and fullscreen:

//Clear out our D3DPRESENT_PARAMETERS structure. Even though we''re going
//to set virtually all of it members, it''s good practice to zero it out first.

//Whether we''re full-screen or windowed these are the same.
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; // Throw away previous frames, we don''t need them
d3dpp.hDeviceWindow = g_main_window; //This is our main (and only) window
d3dpp.BackBufferCount= 1; //We only need a single back buffer

//We need a Z-Buffer so everything will be drawn properly
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;

// BackBufferWidth/Height have to be set for full-screen apps, these values are
//used (along with BackBufferFormat) to determine the display mode.
//They aren''t needed in windowed mode since the size of the window will be used.
// BackBufferFormat is the pixel format we want. In windowed mode we use the same
//format as the desktop (which we found by using GetAdapterDisplayMode() above).
//In full-screen we need to find a pixel format we like, see find_16bit_mode()
//below for more details.
d3dpp.Windowed = FALSE;
d3dpp.BackBufferWidth = g_width;
d3dpp.BackBufferHeight = g_height;
d3dpp.BackBufferFormat = find_16bit_mode();
d3dpp.Windowed = TRUE;
d3dpp.BackBufferFormat = display_mode.Format;

Share this post

Link to post
Share on other sites
here''s the routine to find an available 16bit mode

// Function:find_16bit_mode
// Whazzit:Tests a couple of 16-bit modes to see if they are supported. Virtually every graphics
// card in existance will support one of these 2 formats.
D3DFORMAT find_16bit_mode(void){

//First we test for R5G6B5. All 16-bits are used in this format giving us a full 64K worth
//worth of colours
return D3DFMT_R5G6B5;

//Next try X1R5G5B5. Since 1 bit is wasted it''s technically a 15-bit mode and only
//provides 32K colours, though you''d be hard pressed to tell the difference between
//15- & 16-bit modes.
return D3DFMT_X1R5G5B5;

//This is a freaky card. Complain and bail out.
FatalError("Couldn''t find a decent mode\n");

//Won''t actually hit this line since FatalError() kills us, but it makes the compiler happy.

Share this post

Link to post
Share on other sites
Try enumerating all video modes and their parameters and initializing one of them. Also, check precisely what headers do you use and what DirectX version is installed. I''ve seen initialization issues when working with DX8.1 headers and DX8.0(a) installed.

I hope this helps
- Lifepower

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!