Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 996671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:54:53+00:00 2026-05-16T06:54:53+00:00

Attempting to do SetData() on Texture2D that has been recently Draw()-n by SpriteBatch leads

  • 0

Attempting to do SetData() on Texture2D that has been recently Draw()-n by SpriteBatch leads to following exception:

The operation was aborted. You may not modify a resource that has been set on a device, or after it has been used within a tiling bracket.

Can I determine in advance if executing SetData() will throw this exception?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:54:54+00:00Added an answer on May 16, 2026 at 6:54 am

    Basically, you have three options:

    1) See if SpriteBatch has finished it’s operation and call SetData() afterwards. The drawing methods usually are asynchronous. That means that, they just get added to the please-render-me queue and the method returns immediately. What you need is either a callback notification when the drawing has finished or a synchronous call to Draw().

    2) Avoiding that SetData() gets interrupted. You can do that by putting it into a critical section which I would not recommend. It should be possible to lock the texture data. It’s called LockRect() in Direct3D, it should be similar in XNA.

    3) There should be some method like Flush() somewhere that waits until all graphics-related operation have finished.

    Sorry for the rather vague help, but you should be able to find the method names from the XNA doc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to make a NSObject called 'Person' that will hold the login details for
Attempting to build a C# project which has numerous references to assemblies in NuGet
if the parent's datasource has a child property that is a collection (let's say
Attempting to compile the following code under Qt SDK 4.7.4 for Desktop - MinGW
Attempting to run adt from an SSH session results in: Exception in thread main
Attempting to use asp.net mvc's Action Result of File. So it would seem that
Attempting to set the tabIndex for date_select has proven to be difficult out of
Attempting to move an uploaded file so that it is saved in the directory,
Just attempting this question I found in a past exam paper so that I
In attempting to run ./manage.py runserver or shell or any other command for that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.