|
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn),
581
guests, and 0
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
CRASH in Matt's RENDERVIEW.DLL
#50724
08/04/05 15:12
08/04/05 15:12
|
Joined: Aug 2005
Posts: 1,185 Ukraine
Lion_Ts
OP
Serious User
|
OP
Serious User
Joined: Aug 2005
Posts: 1,185
Ukraine
|
Hi ! Quick explanation: 'crash in render_backbuffer(entity)' when - win key, alt+tab, etc. pressed
- change resolution
Things like Code:
if(window_focus==1){render_backbuffer(entity);}
or disabling system keys is not work. I don't have renderview.dll sources and I'm very bad programmer, so CAN it be fixed ? PLEASE. DLL is good, but d3d_device loosing is messed. Matt, help if you can.
|
|
|
Re: CRASH in Matt's RENDERVIEW.DLL
[Re: Matt_Aufderheide]
#50728
08/05/05 12:30
08/05/05 12:30
|
Joined: Aug 2005
Posts: 1,185 Ukraine
Lion_Ts
OP
Serious User
|
OP
Serious User
Joined: Aug 2005
Posts: 1,185
Ukraine
|
Oh, no... Ok, Matt. Do You plan to give the sources of renderview.dll to public domain ? May be some one else can fix it... It seems to me, this crash is a serious fault to use renderview.dll in commercial quality games.
Last edited by Lion_Ts; 08/05/05 14:48.
|
|
|
Re: CRASH in Matt's RENDERVIEW.DLL
[Re: Lion_Ts]
#50729
08/05/05 19:11
08/05/05 19:11
|
Joined: Oct 2003
Posts: 4,131
Matt_Aufderheide
Expert
|
Expert
Joined: Oct 2003
Posts: 4,131
|
|
|
|
Re: CRASH in Matt's RENDERVIEW.DLL
[Re: xoNoid]
#50731
08/07/05 18:53
08/07/05 18:53
|
Joined: Aug 2005
Posts: 1,185 Ukraine
Lion_Ts
OP
Serious User
|
OP
Serious User
Joined: Aug 2005
Posts: 1,185
Ukraine
|
To xoNoid: How about crash, when win-key pressed ? To Matt: I just write down my own renderview.dll, first try is slow, because i'm using LoadSurfaceFromSurface, i plan to change it with StretchBlt. And I have same error, I think it related to preload_bmap. What do You think ? Do I have to purge bmap from memory in dll when d3d device lost ? Anyway, thanks, Matt.
Last edited by Lion_Ts; 08/07/05 18:58.
|
|
|
Re: CRASH in Matt's RENDERVIEW.DLL
[Re: Lion_Ts]
#50732
08/10/05 11:24
08/10/05 11:24
|
Joined: Aug 2005
Posts: 1,185 Ukraine
Lion_Ts
OP
Serious User
|
OP
Serious User
Joined: Aug 2005
Posts: 1,185
Ukraine
|
Hi, Matt ! I forgot to release surfaces on d3d_lost, crash is gone for now. I'll plan to use fast gdi functions to blit surfaces. But 3dgs engine stucks at shutdown (about 15 secs) with my dll. My dll cannot unloaded correctly, I think. Matt, point me to the right way, please. lion_ts@ukr.netCode:
#define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdlib.h> #include <malloc.h> #include <memory.h> #include <tchar.h> #include <math.h.> #define DLL_USE #include "adll.h" #include <d3dx9.h> #include <d3dx9tex.h> #include "DXUtil.h"
ENTITY* rent; BMAP* texbmap; LPDIRECT3DTEXTURE9 d3dtex=NULL; LPDIRECT3DSURFACE9 m_pRenderTarget=NULL; LPDIRECT3DSURFACE9 m_pRenderTex=NULL;
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { engine_bind(); switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: // engine_bind(); break; case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: SAFE_RELEASE(m_pRenderTarget); SAFE_RELEASE(m_pRenderTex); } return TRUE; } //d3d device lost DLLFUNC void d3d_lost_() { SAFE_RELEASE(m_pRenderTarget); SAFE_RELEASE(m_pRenderTex); } //d3d device recreate DLLFUNC void d3d_reset_() { } //renders backbuffer DLLFUNC void RenderBBuff(ENTITY *ent) { HRESULT hr; // HDC* SourceDC; // HDC* DestDC;
if (!ent) return; LPDIRECT3DDEVICE9 pd3ddev= (LPDIRECT3DDEVICE9)draw_begin(); if (FAILED(hr=pd3ddev->TestCooperativeLevel())) return; if(FAILED(hr = pd3ddev->GetBackBuffer(0,0,D3DBACKBUFFER_TYPE_MONO, &m_pRenderTarget))) goto err_ ; if (ent!=rent || !m_pRenderTex){ SAFE_RELEASE(m_pRenderTex); rent=ent; texbmap = bmap_for_entity(ent,0); if (!texbmap) goto err_; d3dtex = (LPDIRECT3DTEXTURE9)bmap_preload(texbmap); if (!d3dtex) goto err_; if (FAILED(hr = d3dtex->GetSurfaceLevel(0,&m_pRenderTex))) goto err_;//return; } if (FAILED(D3DXLoadSurfaceFromSurface(m_pRenderTex,NULL,NULL,m_pRenderTarget,NULL,NULL,D3DX_FILTER_POINT,0))) goto err_;//return; err_: ; SAFE_RELEASE(m_pRenderTarget); SAFE_RELEASE(m_pRenderTex); }
|
|
|
|