Jump to content


Photo

Solve the display_reset() bug in GM8.1.141


  • Please log in to reply
5 replies to this topic

#1 Bart

Bart

    WiseBart

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

Posted 13 January 2013 - 08:53 PM

Hello all. Some of you may have encountered the bug in GM8.1.141 when using display_reset(). Because of this bug, the game 'hangs' when display_reset() is called.
Almost by accident, I might have found a workaround for this.

After calling display_reset(), create a new surface, set the render target to this surface, then reset the render target, like this:
// Anti-aliasing
display_reset(aa);

// Solve display_reset() bug
var sf; sf = surface_create(16,16);
surface_set_target(sf);
surface_reset_target();
surface_free(sf);
This appears to work for me. After executing the additional lines of code, the game still runs fine and anti-aliasing is clearly enabled.

To the moderators: please feel free to move this topic, I wasn't sure where to place it ...
  • 6

My marketplace assets: Instance Toolkit | Particle Billboards


#2 Desert Dog

Desert Dog

    GMC Member

  • GMC Elder
  • 6409 posts
  • Version:Unknown

Posted 13 January 2013 - 10:18 PM

Interesting tip. Never played with display_reset(), just gave it a test, and my whole screen started acting twitchy.. added in your fix and yea, that stopped that.

Moving to the legacy forum. This'll get quickly buried in the Q&A forum!

Thanks for sharing!
  • 2
HTML5 games for mobile:
HexDogs Bugz Burn! Captain George Golfing Block Memory

Games for Androids
*NEW* Word Dog - Published by Dangerous_Dave


Code: General Array Functions - GM-S friendly. sorting, shuffling. Includes a quicksort.
Use the quicksort to sort ds_lists 10-18 times faster than ds_list_sort()!

#3 Tarik

Tarik

    GMC Member

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

Posted 22 January 2013 - 01:32 PM

Haha, how you even came up with this is beyond me. Hope it didn't take many hours of trial and error! Thanks for posting. Did anyone encounter this stuff in GMS by the way?

Robert, Mike's last name has a double l.
  • 2

#4 Big J

Big J

    GMC Member

  • GMC Member
  • 2853 posts
  • Version:GM8.1

Posted 23 January 2013 - 08:06 AM

Wow, this really works!
Posted Image
8x MSAA! :biggrin:

This even answers my old question here: http://gmc.yoyogames...howtopic=562612

Well done.

Edited by Big J, 23 January 2013 - 08:10 AM.

  • 1

Get your GM 8.1 Anti-Aliasing here!

2712265.png

http://www.youtube.com/Sporkinator


#5 Spikehead777

Spikehead777

    GMC Member

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

Posted 26 January 2013 - 02:47 AM

Wow, that's awesome. One of my projects wasn't hanging with display_reset(...), but all of my others were, and I could not figure it out. Now I think I can go back and fix the first project. This greatly simplifies some of my models in other projects that had the hanging bug, as I can now enable anti-aliasing globally and remove some CPU-intensive code.
  • 1

#6 nottud

nottud

    GMC Member

  • GMC Member
  • 130 posts

Posted 07 July 2013 - 05:05 PM

The fix works! :) +1


  • 0