Jump to content


Photo

d3d_start in Draw?


  • Please log in to reply
3 replies to this topic

#1 Erik Leppen

Erik Leppen

    GMC Member

  • GMC Member
  • 2028 posts
  • Version:GM:Studio

Posted 03 July 2012 - 05:39 PM

Suddenly I was thinking, "what does d3d_start actually do?" so I decided I should take a look in the manual. There I find:

d3d_start()
This code has been placed at the start of the draw event of an instance to tell GameMaker:Studio that all further drawing should be done in 3D mode.

(emphasis mine) and the same for d3d_end. Has this always been that way? Have I always done it wrong? Because when I created a d3d game, I usulaly just used d3d_start in the Create of a controller object and d3d_end in the Destroy. But as it looks now, I should start d3d mode in a Draw event and end it in the same event.

Has this always been that way (the GM8.1 manual says nothing about events in the page about d3d_start and d3d_end)?
  • 0

#2 the sivart

the sivart

    GMC Member

  • GMC Member
  • 145 posts
  • Version:GM:Studio

Posted 03 July 2012 - 05:47 PM

well it seems to me that it just tells gm that all draw events will now be drawn in 3D. so as long as you call it at least once before drawing anything then it should do the same thing. however I'm not sure about this but I think it used to also refresh the screen or something like that so using it every step would kill the FPS.
  • 0

#3 alexandervrs

alexandervrs

    GMC Member

  • GMC Member
  • 417 posts
  • Version:GM:Studio

Posted 03 July 2012 - 06:33 PM

I thought d3d_start() initializes the whole d3d system and as such it should be put in the Create Event, also d3d_end() is useful if you want to leave d3d mode at some point.
I believe the manual is wrong here, d3d_primitive_begin() works like that, not d3d_start().

Edited by alexandervrs, 03 July 2012 - 06:42 PM.

  • 0

#4 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2435 posts
  • Version:GM:Studio

Posted 03 July 2012 - 06:49 PM

I believe Nocturne was tasked with rewriting the manual, might've been writing a bit too fast there! Good thing you brought this to attention! This is of course (I believe...) wrong, you only need to activate it once during the course of the game.
I have no idea what it actually does though. Does it do anything other than start the z buffer and enable perspective?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users