Dawn/src/dawnvita/error/error.cpp

34 lines
923 B
C++

// Copyright (c) 2024 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "error/error.hpp"
#include <vitasdk.h>
#include "dawnopengl.hpp"
void errorMessageBox(const std::u8string &message) {
SceMsgDialogUserMessageParam msg_param;
memset(&msg_param, 0, sizeof(msg_param));
msg_param.buttonType = SCE_MSG_DIALOG_BUTTON_TYPE_OK;
msg_param.msg = (SceChar8 *)message.c_str();
SceMsgDialogParam param;
sceMsgDialogParamInit(&param);
_sceCommonDialogSetMagicNumber(&param.commonParam);
param.mode = SCE_MSG_DIALOG_MODE_USER_MSG;
param.userMsgParam = &msg_param;
sceMsgDialogInit(&param);
while(sceMsgDialogGetStatus() != SCE_COMMON_DIALOG_STATUS_FINISHED) {
glClear(GL_COLOR_BUFFER_BIT);
vglSwapBuffers(GL_TRUE);
}
sceMsgDialogTerm();
}
void errorLog(const std::string &message) {
std::cerr << message << std::endl;
}