小编Cow*_*ion的帖子

C++访问冲突类阵列

我一直试图修复此访问冲突异常数小时!任何帮助表示赞赏!

我试过让这个类中的所有变量都是静态的,仍然得到未处理的异常!

Case.hpp

class CCase {
public:
Texture tex_Case;
Sprite spt_Case;
Text txt_CaseNumber;
int i_CaseNum, i_CaseValue;
bool b_PersonalCase = false, b_CaseRemoved = false;

void DrawCase(RenderWindow* window) {
    FloatRect caseRect = spt_Case.getGlobalBounds();
    FloatRect textRect = txt_CaseNumber.getLocalBounds();
    txt_CaseNumber.setOrigin(textRect.left + textRect.width / 2.0f, textRect.top + textRect.height / 2.0f);
    txt_CaseNumber.setPosition(Vector2f(caseRect.left + caseRect.width / 2.0f, caseRect.top + caseRect.height / 2.0f));

    window->draw(spt_Case);
    window->draw(txt_CaseNumber);
}
CCase(RenderWindow* window, int CaseNum, int CaseValue) {
    i_CaseNum = CaseNum;
    i_CaseValue = CaseValue;

    tex_Case = ENG::TextureFromFile(window, "Data//Images//Case.jpg", "DrawGame", true, false, true);

    spt_Case.setTexture(tex_Case); …
Run Code Online (Sandbox Code Playgroud)

c++ exception class sfml

2
推荐指数
1
解决办法
59
查看次数

标签 统计

c++ ×1

class ×1

exception ×1

sfml ×1