• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows Series of errors popup before game will run. "Win32 function failed:"

Mike

nobody important
GMC Elder
Looks like it's not able to create the basic screen/back buffer. Is your card fully DX11 compatible? Update your drivers+windows etc...

Failing that... contact the helpdesk and include a DXDiag output.
 
R

RealityShifter

Guest
Looks like it's not able to create the basic screen/back buffer. Is your card fully DX11 compatible? Update your drivers+windows etc...

Failing that... contact the helpdesk and include a DXDiag output.
Everything is up to date now. Still same issue. I will contact helpdesk but this also happens on my laptop. So I think something is wrong with the project file.
 

FrostyCat

Redemption Seeker
Have you tried building a blank project yet? This would tell you whether the problem lies with your project specifically or your general setup.
 
R

RealityShifter

Guest
Have you tried building a blank project yet? This would tell you whether the problem lies with your project specifically or your general setup.
Good idea, yeah it seems to just be this project.
 
S

samuelesque

Guest
Spent the evening tracking this down.
I had a problem with camera_get_view_width and camera_get_view_height that resulted in trying to create a surface with a width and height both equal to zero.
I'm likely just doing something wrong there, but fixed these popups for now by hardcoding values into my surface_create() call.

surface_create(0,0) = these same windows.
surface_create(960,360) = no problems.

Documentation calls out surface_create needing specific power of 2 values for parameters for some platforms. Worth checking out.
Hope this helps someone.

Cheers!
 
R

Robert Kern

Guest
I had the same problem when I tried creating a surface with width and height set to zero. I was accidently creating the surface before I initialized my display size variables. It seems like it's the same thing. You should be able to attacher the debugger and check your surface_create calls and figure out which one is being called improperly.
 

Mike

nobody important
GMC Elder
Can some one file this? It shouldn't crash if you do this, just report a normal runtime code error.
 
E

Excalipur

Guest
Seems like a bug with GM to me. I had these exact same error messages, which showed up at the start of every room and when I change from fullscreen to windowed or vice versa (when the camera is modified). I fixed it by creating a new camera every time a room starts instead of changing the existing camera manually. It seems somehow the width/height of the view was considered -1/-1, even when I set "view_set_camera()" and "camera_set_view_size()" to the correct values, except when making it fresh with "camera_create_view()".

Also interesting to note, is that after the five errors, the game actually played like normal, until the camera changed again. So even though it showed those errors for one frame, I guess it somehow fixed it for the next frame.
 
R

RealityShifter

Guest
I 100% assure you I am not creating any surfaces with size 0 or outside the power of 2. Still struggling with this. I'm also finding that if I simply tell a surface to draw on top of itself it looks completely screwy.
 

kumitassu

Member
I got similiar error messages this week. I don't remember exactly why I got those but I did something wrong that was related with surfaces and I didn't write it down what I did wrong. Have you tried to locate problem with debugger?
 
R

RealityShifter

Guest
Seems like a bug with GM to me. I had these exact same error messages, which showed up at the start of every room and when I change from fullscreen to windowed or vice versa (when the camera is modified). I fixed it by creating a new camera every time a room starts instead of changing the existing camera manually. It seems somehow the width/height of the view was considered -1/-1, even when I set "view_set_camera()" and "camera_set_view_size()" to the correct values, except when making it fresh with "camera_create_view()".

Also interesting to note, is that after the five errors, the game actually played like normal, until the camera changed again. So even though it showed those errors for one frame, I guess it somehow fixed it for the next frame.
This helped me narrow it down to a room changing issue, thanks. Working on a solution now.
 
A

Anomaly

Guest
Spent the evening tracking this down.
I had a problem with camera_get_view_width and camera_get_view_height that resulted in trying to create a surface with a width and height both equal to zero.
I'm likely just doing something wrong there, but fixed these popups for now by hardcoding values into my surface_create() call.

surface_create(0,0) = these same windows.
surface_create(960,360) = no problems.

Documentation calls out surface_create needing specific power of 2 values for parameters for some platforms. Worth checking out.
Hope this helps someone.

Cheers!

just if anyone else comes across this ...

i got the windows errors but it did not crash the game..it interrupted the game but after i clicked ok on all the windows, I could resume the game, though my intended thing that was causing the errors did not happen..

i had put
surface_create(room_width, room_height); = these same windows

changed to:
surface_create(1920,1080); = no problems.

NOTE: i was following a tutorial on surfaces where the guy was using GameMaker Studio 1. something. Not 2.

thing is.. i used all the original same code (using room_width / height)... in a fresh room with nothing else except the surface manager and enemy in his tutorial, and it worked fine.. no Win32 error popup problems.
blank fresh room dimensions being 1024 x 768, not like my intended room's, being 1920 x 1080 just FYI

so for me at least this was the decisive issue that caused the problem(s)
 

Bawat

Member
Thought I'd add how I solved my issue.

Win32 function failed: HRESULT: 0x887a0005

Call: GR_D3D_Device-> CreateBlendState at line 467 in file\StateManagerM.cpp
Device lost - reason: 0x887a0006

My shader was expecting an int and I was providing it with a float by accident
GML:
shader_set_uniform_f(numberOfLightsUniform, index/4);
 
Top