From patchwork Thu Jul 21 12:36:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandros Frantzis X-Patchwork-Id: 2914 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A4AFE23F4D for ; Thu, 21 Jul 2011 12:36:45 +0000 (UTC) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.216.173]) by fiordland.canonical.com (Postfix) with ESMTP id 5D535A184BF for ; Thu, 21 Jul 2011 12:36:45 +0000 (UTC) Received: by mail-qy0-f173.google.com with SMTP id 10so3959338qyk.11 for ; Thu, 21 Jul 2011 05:36:45 -0700 (PDT) Received: by 10.229.68.200 with SMTP id w8mr185065qci.114.1311251805123; Thu, 21 Jul 2011 05:36:45 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.217.78 with SMTP id hl14cs139337qcb; Thu, 21 Jul 2011 05:36:44 -0700 (PDT) Received: by 10.216.30.9 with SMTP id j9mr157019wea.82.1311251795704; Thu, 21 Jul 2011 05:36:35 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id l59si2394968wed.39.2011.07.21.05.36.35; Thu, 21 Jul 2011 05:36:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QjsUT-0000Cp-PM for ; Thu, 21 Jul 2011 12:36:33 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 9589E2EA1B8 for ; Thu, 21 Jul 2011 12:36:32 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 36 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 36: Whitespace fixes. Message-Id: <20110721123632.17019.38487.launchpad@loganberry.canonical.com> Date: Thu, 21 Jul 2011 12:36:32 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13475"; Instance="initZopeless config overlay" X-Launchpad-Hash: 132bad88384a30198f89e33e6c1368ebbbf939d4 ------------------------------------------------------------ revno: 36 committer: Alexandros Frantzis timestamp: Fri 2010-07-09 17:21:56 +0300 message: Whitespace fixes. modified: main.cpp scene.h scenetexture.cpp screen.cpp texture.cpp --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === modified file 'main.cpp' --- main.cpp 2010-07-09 12:11:52 +0000 +++ main.cpp 2010-07-09 14:21:56 +0000 @@ -9,7 +9,7 @@ int running = 1; unsigned current_scene = 0; Screen screen; - + printf("===================================================\n"); printf(" GLMark 08\n"); printf("===================================================\n"); @@ -71,14 +71,14 @@ running = false; } - + screen.update(); } - + unsigned score = 0; for (unsigned i = 0; i < num_scenes; i++) score += scene[i]->calculate_score(); - + printf("===================================================\n"); printf("Your GLMark08 Score is %u ^_^\n", score); printf("===================================================\n"); === modified file 'scene.h' --- scene.h 2010-07-09 13:36:15 +0000 +++ scene.h 2010-07-09 14:21:56 +0000 @@ -21,10 +21,10 @@ virtual void start(); virtual void update(); virtual void draw(); - + unsigned calculate_score(); bool is_running(); - + protected: unsigned mPartsQty; // How many parts for the scene unsigned mCurrentPart; // The current part being rendered @@ -33,7 +33,7 @@ double mLastTime, mCurrentTime, mDt; unsigned mCurrentFrame; bool mRunning; - + unsigned *mAverageFPS; // Average FPS per part float *mScoreScale; @@ -52,7 +52,7 @@ void start(); void update(); void draw(); - + ~SceneBuild(); protected: @@ -72,9 +72,9 @@ void start(); void update(); void draw(); - + ~SceneTexture(); - + protected: Shader mShader; @@ -93,9 +93,9 @@ void start(); void update(); void draw(); - + ~SceneShading(); - + protected: Shader mShader[2]; === modified file 'scenetexture.cpp' --- scenetexture.cpp 2010-07-09 13:36:15 +0000 +++ scenetexture.cpp 2010-07-09 14:21:56 +0000 @@ -10,41 +10,41 @@ int SceneTexture::load() { Model model; - + if(!model.load_3ds(GLMARK_DATA_PATH"data/models/cube.3ds")) return 0; - + if(!load_texture(GLMARK_DATA_PATH"data/textures/crate-base.bmp", mTexture)) return 0; - + model.calculate_normals(); model.convert_to_mesh(&mCubeMesh); mCubeMesh.build_vbo(); mShader.load(GLMARK_DATA_PATH"data/shaders/light-basic.vert", GLMARK_DATA_PATH"data/shaders/light-basic-tex.frag"); - + mRotationSpeed = Vector3f(36.0f, 36.0f, 36.0f); - + mRunning = false; - + mPartsQty = 3; mPartDuration = new double[mPartsQty]; mAverageFPS = new unsigned[mPartsQty]; mScoreScale = new float[mPartsQty]; - + mScoreScale[0] = 0.471f; mScoreScale[1] = 0.533f; mScoreScale[2] = 0.405f; - + mPartDuration[0] = 10.0; mPartDuration[1] = 10.0; mPartDuration[2] = 10.0; - + memset(mAverageFPS, 0, mPartsQty * sizeof(*mAverageFPS)); mCurrentPart = 0; - + return 1; } @@ -60,7 +60,7 @@ GLfloat lightDiffuse[] = {0.8f, 0.8f, 0.8f, 1.0f}; GLfloat lightPosition[] = {20.0f, 20.0f, 10.0f, 1.0f}; GLfloat materialColor[] = {1.0f, 1.0f, 1.0f, 1.0f}; - + mShader.use(); // Load lighting and material uniforms @@ -82,25 +82,24 @@ mCurrentTime = SDL_GetTicks() / 1000.0; mDt = mCurrentTime - mLastTime; mLastTime = mCurrentTime; - + mElapsedTime = mCurrentTime - mStartTime; - + if(mElapsedTime >= mPartDuration[mCurrentPart]) { mAverageFPS[mCurrentPart] = mCurrentFrame / mElapsedTime; - - switch(mCurrentPart) - { - case 0: - printf("Texture filtering\n"); - printf(" Nearest FPS: %u\n", mAverageFPS[mCurrentPart]); - break; - case 1: - printf(" Linear FPS: %u\n", mAverageFPS[mCurrentPart]); - break; - case 2: - printf(" Mipmapped FPS: %u\n", mAverageFPS[mCurrentPart]); - break; + + switch(mCurrentPart) { + case 0: + printf("Texture filtering\n"); + printf(" Nearest FPS: %u\n", mAverageFPS[mCurrentPart]); + break; + case 1: + printf(" Linear FPS: %u\n", mAverageFPS[mCurrentPart]); + break; + case 2: + printf(" Mipmapped FPS: %u\n", mAverageFPS[mCurrentPart]); + break; } mCurrentPart++; if(mCurrentPart >= mPartsQty) @@ -108,9 +107,9 @@ else start(); } - + mRotation += mRotationSpeed * mDt; - + mCurrentFrame++; } === modified file 'screen.cpp' --- screen.cpp 2010-07-09 14:14:04 +0000 +++ screen.cpp 2010-07-09 14:21:56 +0000 @@ -38,7 +38,7 @@ } if(mFullScreen) - mFlags = SDL_OPENGL | SDL_FULLSCREEN; + mFlags = SDL_OPENGL | SDL_FULLSCREEN; mInfo = SDL_GetVideoInfo(); === modified file 'texture.cpp' --- texture.cpp 2010-07-09 14:15:21 +0000 +++ texture.cpp 2010-07-09 14:21:56 +0000 @@ -36,22 +36,22 @@ // Create Nearest Filtered Texture glBindTexture(GL_TEXTURE_2D, pTexture[0]); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, nOfColors, surface->w, surface->h, 0, texture_format, GL_UNSIGNED_BYTE, surface->pixels); // Create Linear Filtered Texture glBindTexture(GL_TEXTURE_2D, pTexture[1]); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, nOfColors, surface->w, surface->h, 0, texture_format, GL_UNSIGNED_BYTE, surface->pixels); // Create trilinear filtered mipmapped texture glBindTexture(GL_TEXTURE_2D, pTexture[2]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, nOfColors, surface->w, surface->h, 0, texture_format, GL_UNSIGNED_BYTE, surface->pixels); glGenerateMipmap(GL_TEXTURE_2D);