ROFL - I know that you are an experienced coder and all. But, this doesn't mean that someone else can't think out of the box once in a while too.
Want to talk about 'doing it wrong'? Why in gods name is there 107 render state changes in GMS before rendering a single pixel to the screen? I have asked you this quite a few times, but you have avoided the question over and over and over.
The renderer should (with application surface disabled) consist solely of Begin, (Clear - optional), and Present.
I have done this myself, by creating my own renderer for GMS, and absolutely $hitted all over the inbuilt renderer with my 'Catch the clown' remake that everyone believed was fraudulent because the results doubled in framerate.
I must have been lucky in 'doing it wrong then too'
I don't know how gm works. I can't say that what I'll say is true, this is just what I think.
GameMaker is an engine which targets users with little or no experience in game making. For that reason, GameMaker makes sure to do everything possible in the background so that you
don't have to bether even thinking about it and just focus on your game.
With that said, that means GameMaker has to take decisions based on many different contexts. Because of that, it is very possible that GameMaker finds evidences of a specific action,
so it prepares to take that action, and then realizes that instead, it was another action, so it proceeds to stopping doing what it was about to do and prepares for the other action instead.
You could see it like this: Say you see someone sneeze a lot. What is it? Is it a cold? Is it allergies? Is it just a coincidence? you can't guess.
But what if you definitly need to take action NOW. Well you'll have to choose one of those. And if in the end it wasn't that, you'll change your action as you
get more information.
This is how I think GameMaker works behind the scene. For that reason, I think it is perfectly normal for GameMaker to make many different draw calls even if you do only one draw.
NOTE: You mentionned something very interesting: before drawing a single pixel. GameMaker is optimized to ddraw sprite batches, not pixels.
So that brings me to mike's comment: Maybe you are using GameMaker incorrectly. Yes, you made a dll that does what youre doing better... But what if it's because you aren't using GameMaker the way it is intended to be used?
Again, I'd like to remind you that this is just guesses, my opinion, and I could be completly wrong.
Please do not take offense if that's the case