Goombert
|
|
Reply #30 Posted on: October 02, 2014, 06:09:14 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Those are actually warnings, you only have one error actually. D:\Users\Jason\AppData\Local\Temp\ccD9ph1j.ltrans20.ltrans.o:ccD9ph1j.ltrans20.o:(.text+0x540): undefined reference to `enigma_user::window_device()' D:\Users\Jason\AppData\Local\Temp\ccD9ph1j.ltrans21.ltrans.o:ccD9ph1j.ltrans21.o:(.text+0x414): undefined reference to `enigma_user::window_device()'
When you moved window_device, did you leave it in namespace enigma_user {} ?
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
lonewolff
|
|
Reply #31 Posted on: October 02, 2014, 06:23:06 pm |
|
|
"Guest"
|
Line 40 in WINDOWSMain.h (right inside namespace enigma_user {} )
void* window_device();
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #32 Posted on: October 02, 2014, 06:23:57 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
No, in the source (graphics_bridge.cpp)?
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
lonewolff
|
|
Reply #33 Posted on: October 02, 2014, 06:30:00 pm |
|
|
"Guest"
|
Oh as in like this? void* enigma_user::window_device()? Nope, although it worked the ther day without enigma_user:: at the front. My daughter is on my PC right now, so will test in a bit. [off topic] I just found out I get a Win8 tablet today. Work is feeling generous! Happy days!
|
|
« Last Edit: October 02, 2014, 06:31:47 pm by lonewolff »
|
Logged
|
|
|
|
lonewolff
|
|
Reply #34 Posted on: October 02, 2014, 08:00:06 pm |
|
|
"Guest"
|
Just tried this in graphics_bridge.cpp void* enigma_user::window_device() { return (void*)d3dmgr->device; }
Still the same error. I am sure I am making a silly mistake somewhere. [edit] ** Damn! This default OpenGL thing gets me every time..... LOL
|
|
« Last Edit: October 02, 2014, 08:05:27 pm by lonewolff »
|
Logged
|
|
|
|
|
lonewolff
|
|
Reply #36 Posted on: October 02, 2014, 08:11:32 pm |
|
|
"Guest"
|
I just Ninja'd you. I had project settings on OpenGL Not used to the defaults on ENIGMA. Compiled fine but app still crashes when trying to draw a textured quad. So, more investigating at my end now (DLL works fine in GM:S)
|
|
|
Logged
|
|
|
|
|
|
lonewolff
|
|
Reply #39 Posted on: October 02, 2014, 08:38:42 pm |
|
|
"Guest"
|
Still crashes on my create_quad() call, even though the window_device seems to be returning a good value So this is what I have. Create eventdll_name="t.dll";
init=external_define(dll_name,"init",dll_cdecl,ty_real,1,ty_string); create_quad=external_define(dll_name,"createQuad",dll_cdecl,ty_real,0); draw_quad=external_define(dll_name,"drawQuad",dll_cdecl,ty_real,0);
aaa=external_call(init,window_device()); bbb=external_call(create_quad); // *** THIS IS CAUSING ENIGMA TO CRASH ***
Part of the DLLexport double init(void* mD3dDevice) { d3dDevice=(IDirect3DDevice9*)mD3dDevice;
if(!d3dDevice) return 1000;
return 0; }
The above returns 0 and window_device() in EDL returns a nice hex value. The following call causes ENIGMA to crash even though I use error checking. export double createQuad() { if(!d3dDevice) return 1000;
int nNumVerts=4;
if(FAILED(d3dDevice->CreateVertexBuffer((nNumVerts)*sizeof(D3DVERTEX),D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY,D3DFVF_XYZRHW|D3DFVF_DIFFUSE,D3DPOOL_DEFAULT,&pVertexObjectQuad,NULL))); return 1;
return 0; }
How can this possibly cause a crash? If it fails it should just return '1' to the calling function. This is wierd as... On GM:S, if I leave out the call to get window_device() (to force an error) then create_quad will return 1 as expected. If I do the same with ENIGMA it shits itself and crashes. So, the problem isn't related to window_device anymore. It is to do with ENIGMA crashing if a error checked directx call happens. I just can understand why an error handled call should crash anything. Possibly something to do with my DLL built on MSVC? I have also checked that we don't have a DX9 (subversion) conflict. My DLL is using d3dx9_43 (June 2010 SDK). From what I can see, ENIGMA is built on the same version of DX9. Only difference now that I can see is MinGW & MSVC.
|
|
« Last Edit: October 02, 2014, 09:14:47 pm by lonewolff »
|
Logged
|
|
|
|
|
Goombert
|
|
Reply #41 Posted on: October 03, 2014, 07:38:20 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Sorlok is right, it's a garbage pointer and you are checking if its null, its obviously not null because it's a garbage pointer, and then you try to access it inside the FAILED() call which leads to a segfault. Run the game in debug mode to build with debug symbols, then open git-bash and type "gdb path/to/temp/file/from/lgmsconsole" and hit enter, then when it loads the temp file LGM outputted with debug symbols just type "run" and hit enter and it should launch and then crash giving you a stack trace. Then you type "bt" for the backtrace and it will tell you the exact file and line number it crashed in, though idk if it will get the symbols from the DLL properly or not but it should, if not build a debug version of the dll.
Anyway to prove my point, remove the FAILED() macro and it should still crash. It has nothing to do with DirectX, it is still an issue in the variant.
|
|
« Last Edit: October 03, 2014, 07:41:22 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #43 Posted on: October 03, 2014, 11:07:46 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Ok my apologies sorlok, I have run some tests and it appears your code is working fine.
WINDOWSmain.h
namespace enigma_user { void test_draw_clear(void* d3ddev); void* window_device(); unsigned long long window_handle(); int sleep(int millis); }
graphics_bridge.cpp
void* window_device() { return (void*)d3dmgr->device; }
void test_draw_clear(void* d3ddev) { IDirect3DDevice9* dev = (IDirect3DDevice9*)d3ddev; dev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_RGBA(255, 0, 0, 255), 0, 0); }
Object Draw Event
test_draw_clear(window_device());
Works perfectly as expected and clears the background color to red. It must be an issue with the dll functions then.
|
|
« Last Edit: October 03, 2014, 11:09:23 pm by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
|