本文整理汇总了C++中ILOG函数的典型用法代码示例。如果您正苦于以下问题:C++ ILOG函数的具体用法?C++ ILOG怎么用?C++ ILOG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ILOG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LaunchMarket
void LaunchMarket(const char *url) {
#ifdef _WIN32
ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
#elif __linux__
std::string command = std::string("xdg-open ") + url;
int err = system(command.c_str());
if (err) {
ILOG("Would have gone to %s but xdg-utils seems not to be installed", url)
}
#elif __APPLE__
std::string command = std::string("open ") + url;
system(command.c_str());
#else
ILOG("Would have gone to %s but LaunchMarket is not implemented on this platform", url);
#endif
}
示例2: Java_com_henrikrydgard_libnative_NativeRenderer_displayRender
extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayRender(JNIEnv *env, jobject obj) {
// Too spammy
// ILOG("NativeApp.displayRender()");
if (renderer_inited) {
// TODO: Look into if these locks are a perf loss
{
lock_guard guard(input_state.lock);
pad_buttons_down |= pad_buttons_async_set;
pad_buttons_down &= ~pad_buttons_async_clear;
input_state.pad_buttons = pad_buttons_down;
UpdateInputState(&input_state);
}
{
lock_guard guard(input_state.lock);
input_state.pad_lstick_x = left_joystick_x_async;
input_state.pad_lstick_y = left_joystick_y_async;
NativeUpdate(input_state);
}
{
lock_guard guard(input_state.lock);
EndInputState(&input_state);
}
NativeRender();
time_update();
} else {
ELOG("BAD: Ended up in nativeRender even though app has quit.%s", "");
// Shouldn't really get here. Let's draw magenta.
glstate.depthWrite.set(GL_TRUE);
glstate.colorMask.set(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glClearColor(1.0, 0.0, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
}
if (!frameCommand.empty()) {
ILOG("frameCommand %s %s", frameCommand.c_str(), frameCommandParam.c_str());
jstring cmd = env->NewStringUTF(frameCommand.c_str());
jstring param = env->NewStringUTF(frameCommandParam.c_str());
env->CallVoidMethod(obj, postCommand, cmd, param);
frameCommand = "";
frameCommandParam = "";
}
}
示例3: TestGetMatrix
void TestGetMatrix(int matrix, MatrixSize sz) {
ILOG("Testing matrix %s", GetMatrixNotation(matrix, sz));
u8 fullMatrix[16];
u8 cols[4];
u8 rows[4];
GetMatrixColumns(matrix, sz, cols);
GetMatrixRows(matrix, sz, rows);
GetMatrixRegs(fullMatrix, sz, matrix);
int n = GetMatrixSide(sz);
VectorSize vsz = GetVectorSize(sz);
for (int i = 0; i < n; i++) {
// int colName = GetColumnName(matrix, sz, i, 0);
// int rowName = GetRowName(matrix, sz, i, 0);
int colName = cols[i];
int rowName = rows[i];
ILOG("Column %i: %s", i, GetVectorNotation(colName, vsz));
ILOG("Row %i: %s", i, GetVectorNotation(rowName, vsz));
u8 colRegs[4];
u8 rowRegs[4];
GetVectorRegs(colRegs, vsz, colName);
GetVectorRegs(rowRegs, vsz, rowName);
// Check that the individual regs are the expected ones.
std::stringstream a, b, c, d;
for (int j = 0; j < n; j++) {
a.clear();
b.clear();
a << (int)fullMatrix[i * 4 + j] << " ";
b << (int)colRegs[j] << " ";
c.clear();
d.clear();
c << (int)fullMatrix[j * 4 + i] << " ";
d << (int)rowRegs[j] << " ";
}
ILOG("Col: %s vs %s", a.str().c_str(), b.str().c_str());
if (a.str() != b.str())
ILOG("WRONG!");
ILOG("Row: %s vs %s", c.str().c_str(), d.str().c_str());
if (c.str() != d.str())
ILOG("WRONG!");
}
}
示例4: p
bool RequestHeader::GetParamValue(const char *param_name, std::string *value) const {
if (!params)
return false;
std::string p(params);
std::vector<std::string> v;
SplitString(p, '&', v);
for (size_t i = 0; i < v.size(); i++) {
std::vector<std::string> parts;
SplitString(v[i], '=', parts);
ILOG("Param: %s Value: %s", parts[0].c_str(), parts[1].c_str());
if (parts[0] == param_name) {
*value = parts[1];
return true;
}
}
return false;
}
示例5: NativeInit
void NativeInit(int argc, const char *argv[], const char *savegame_directory, const char *external_directory, const char *installID)
{
host = new NativeHost;
logger = new AndroidLogger();
LogManager::Init();
LogManager *logman = LogManager::GetInstance();
ILOG("Logman: %p", logman);
LogTypes::LOG_LEVELS logLevel = LogTypes::LINFO;
for(int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
{
LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
logman->SetLogLevel(type, logLevel);
}
}
示例6: ILOG
void GLSLProgram::GLRestore() {
// Quoth http://developer.android.com/reference/android/opengl/GLSurfaceView.Renderer.html;
// "Note that when the EGL context is lost, all OpenGL resources associated with that context will be automatically deleted.
// You do not need to call the corresponding "glDelete" methods such as glDeleteTextures to manually delete these lost resources."
// Hence, we comment out:
// glDeleteShader(this->vsh_);
// glDeleteShader(this->fsh_);
// glDeleteProgram(this->program_);
this->program_ = 0;
this->vsh_ = 0;
this->fsh_ = 0;
ILOG("Restoring GLSL program %s/%s",
strlen(this->vshader_filename) > 0 ? this->vshader_filename : "(mem)",
strlen(this->fshader_filename) > 0 ? this->fshader_filename : "(mem)");
glsl_recompile(this);
// Note that any shader uniforms are still lost, hopefully the client sets them every frame at a minimum...
}
示例7: setCurrentThreadName
void VulkanRenderManager::ThreadFunc() {
setCurrentThreadName("RenderMan");
int threadFrame = threadInitFrame_;
bool nextFrame = false;
bool firstFrame = true;
while (true) {
{
if (nextFrame) {
threadFrame++;
if (threadFrame >= vulkan_->GetInflightFrames())
threadFrame = 0;
}
FrameData &frameData = frameData_[threadFrame];
std::unique_lock<std::mutex> lock(frameData.pull_mutex);
while (!frameData.readyForRun && run_) {
VLOG("PULL: Waiting for frame[%d].readyForRun", threadFrame);
frameData.pull_condVar.wait(lock);
}
if (!frameData.readyForRun && !run_) {
// This means we're out of frames to render and run_ is false, so bail.
break;
}
VLOG("PULL: frame[%d].readyForRun = false", threadFrame);
frameData.readyForRun = false;
// Previously we had a quick exit here that avoided calling Run() if run_ was suddenly false,
// but that created a race condition where frames could end up not finished properly on resize etc.
// Only increment next time if we're done.
nextFrame = frameData.type == VKRRunType::END;
assert(frameData.type == VKRRunType::END || frameData.type == VKRRunType::SYNC);
}
VLOG("PULL: Running frame %d", threadFrame);
if (firstFrame) {
ILOG("Running first frame (%d)", threadFrame);
firstFrame = false;
}
Run(threadFrame);
VLOG("PULL: Finished frame %d", threadFrame);
}
// Wait for the device to be done with everything, before tearing stuff down.
vkDeviceWaitIdle(vulkan_->GetDevice());
VLOG("PULL: Quitting");
}
示例8: ILOG
VulkanRenderManager::~VulkanRenderManager() {
ILOG("VulkanRenderManager destructor");
StopThread();
vulkan_->WaitUntilQueueIdle();
VkDevice device = vulkan_->GetDevice();
vkDestroySemaphore(device, acquireSemaphore_, nullptr);
vkDestroySemaphore(device, renderingCompleteSemaphore_, nullptr);
for (int i = 0; i < vulkan_->GetInflightFrames(); i++) {
VkCommandBuffer cmdBuf[2]{ frameData_[i].mainCmd, frameData_[i].initCmd };
vkFreeCommandBuffers(device, frameData_[i].cmdPoolInit, 1, &frameData_[i].initCmd);
vkFreeCommandBuffers(device, frameData_[i].cmdPoolMain, 1, &frameData_[i].mainCmd);
vkDestroyCommandPool(device, frameData_[i].cmdPoolInit, nullptr);
vkDestroyCommandPool(device, frameData_[i].cmdPoolMain, nullptr);
vkDestroyFence(device, frameData_[i].fence, nullptr);
}
queueRunner_.DestroyDeviceObjects();
}
示例9: strlen
uint8_t *VFSReadFile(const char *filename, size_t *size) {
int fn_len = strlen(filename);
for (int i = 0; i < num_entries; i++) {
int prefix_len = strlen(entries[i].prefix);
if (prefix_len >= fn_len) continue;
if (0 == memcmp(filename, entries[i].prefix, prefix_len)) {
ILOG("Prefix match: %s (%s) -> %s", entries[i].prefix, filename, filename + prefix_len);
uint8_t *data = entries[i].reader->ReadAsset(filename + prefix_len, size);
if (data)
return data;
else
continue;
// Else try the other registered file systems.
}
}
ELOG("Missing filesystem for %s", filename);
return 0;
}
示例10: Java_org_ppsspp_ppsspp_NativeApp_shutdown
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) {
if (renderer_inited && useCPUThread && graphicsContext) {
// Only used in Java EGL path.
EmuThreadStop("shutdown");
ILOG("BeginAndroidShutdown");
graphicsContext->BeginAndroidShutdown();
// Skipping GL calls, the old context is gone.
while (graphicsContext->ThreadFrame()) {
ILOG("graphicsContext->ThreadFrame executed to clear buffers");
}
ILOG("Joining emuthread");
EmuThreadJoin();
ILOG("Joined emuthread");
graphicsContext->ThreadEnd();
graphicsContext->ShutdownFromRenderThread();
ILOG("Graphics context now shut down from NativeApp_shutdown");
}
ILOG("NativeApp.shutdown() -- begin");
if (renderer_inited) {
ILOG("Shutting down renderer");
// This will be from the wrong thread? :/
graphicsContext->Shutdown();
delete graphicsContext;
graphicsContext = nullptr;
renderer_inited = false;
} else {
ILOG("Not shutting down renderer - not initialized");
}
NativeShutdown();
VFSShutdown();
while (frameCommands.size())
frameCommands.pop();
ILOG("NativeApp.shutdown() -- end");
}
示例11: ILOG
void IState::deInit(void)
{
ILOG() << "IState::deInit(" << mStateID << ")" << std::endl;
if(true == mInit)
{
mCleanup = true;
mInit = false;
mElapsedTime += mElapsedClock.getElapsedTime().asSeconds();
if(true == mPaused)
{
mPausedTime += mPausedClock.getElapsedTime().asSeconds();
}
}
}
示例12: onVKeyDown
void EmuScreen::pspKey(int pspKeyCode, int flags) {
if (pspKeyCode >= VIRTKEY_FIRST) {
int vk = pspKeyCode - VIRTKEY_FIRST;
if (flags & KEY_DOWN) {
virtKeys[vk] = true;
onVKeyDown(pspKeyCode);
}
if (flags & KEY_UP) {
virtKeys[vk] = false;
onVKeyUp(pspKeyCode);
}
} else {
ILOG("pspKey %i %i", pspKeyCode, flags);
if (flags & KEY_DOWN)
__CtrlButtonDown(pspKeyCode);
if (flags & KEY_UP)
__CtrlButtonUp(pspKeyCode);
}
}
示例13: socket
bool Server::Listen6(int port, bool ipv6_only) {
listener_ = socket(AF_INET6, SOCK_STREAM, 0);
if (listener_ < 0)
return false;
struct sockaddr_in6 server_addr;
memset(&server_addr, 0, sizeof(server_addr));
server_addr.sin6_family = AF_INET6;
server_addr.sin6_addr = in6addr_any;
server_addr.sin6_port = htons(port);
int opt = 1;
// Enable re-binding to avoid the pain when restarting the server quickly.
setsockopt(listener_, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
// Enable listening on IPv6 and IPv4?
opt = ipv6_only ? 1 : 0;
setsockopt(listener_, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&opt, sizeof(opt));
if (bind(listener_, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
closesocket(listener_);
ELOG("Failed to bind to port %i. Bailing.", port);
return false;
}
fd_util::SetNonBlocking(listener_, true);
// 1024 is the max number of queued requests.
if (listen(listener_, 1024) < 0) {
closesocket(listener_);
return false;
}
socklen_t len = sizeof(server_addr);
if (getsockname(listener_, (struct sockaddr *)&server_addr, &len) == 0) {
port = ntohs(server_addr.sin6_port);
}
ILOG("HTTP server started on port %i", port);
port_ = port;
return true;
}
示例14: ILOG
PrototypeManager::~PrototypeManager()
{
ILOG() << "PrototypeManager::dtor()" << std::endl;
// Make sure we delete all registered Prototype classes
std::map<const typePrototypeID, Prototype*>::iterator anPrototypeIter;
// Start at the beginning of the list of ISystem classes
anPrototypeIter = mPrototypes.begin();
while(anPrototypeIter != mPrototypes.end())
{
Prototype* anPrototype = anPrototypeIter->second;
// Remove the Prototype from our list
mPrototypes.erase(anPrototypeIter++);
// Now delete the Prototype
delete anPrototype;
}
}
示例15: closeProxyConnection
void closeProxyConnection(struct proxyConnection *cp) {
if(!(cp->error || cp->done) && !(cp->secure_eof && cp->plain_eof))
return;
DLOG("Closing connection");
int secure_fd=cp->secure->fd;
int status=0;
if(cp->secure_up && !cp->error) {
sslWriteClosureAlert(cp->secure);
}
status=close(cp->secure->fd);
socketShutdown(cp->secure->fd);
sslFreeConnection(&cp->secure);
status=close(cp->plain);
socketShutdown(cp->plain);
memset(cp,0,sizeof(struct proxyConnection));
ILOG("Connection closed");
}