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: 2992 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 4159E23F4D for ; Thu, 21 Jul 2011 12:44:05 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 10D5BA18287 for ; Thu, 21 Jul 2011 12:44:04 +0000 (UTC) Received: by mail-qw0-f52.google.com with SMTP id 8so854415qwb.11 for ; Thu, 21 Jul 2011 05:44:04 -0700 (PDT) Received: by 10.229.217.3 with SMTP id hk3mr210052qcb.38.1311252244597; Thu, 21 Jul 2011 05:44:04 -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 hl14cs139572qcb; Thu, 21 Jul 2011 05:44:04 -0700 (PDT) Received: by 10.216.68.132 with SMTP id l4mr190004wed.41.1311251795979; 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 l18si2388370wed.64.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-0000DN-Sb for ; Thu, 21 Jul 2011 12:36:34 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id B2F292E890C 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: 38 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 38: Replace *ARB functions and constants with their OpenGL (ES) 2.0 equivalents. Message-Id: <20110721123632.17019.65215.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: 2127771300c84496514ac972f919f3dd9a5eebfc ------------------------------------------------------------ revno: 38 committer: Alexandros Frantzis timestamp: Mon 2010-07-12 11:05:45 +0300 message: Replace *ARB functions and constants with their OpenGL (ES) 2.0 equivalents. modified: mesh.cpp shader.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 'mesh.cpp' --- mesh.cpp 2010-07-12 07:57:21 +0000 +++ mesh.cpp 2010-07-12 08:05:45 +0000 @@ -108,7 +108,7 @@ glEnableVertexAttribArray(Shader::NormalAttribLocation); glEnableVertexAttribArray(Shader::TexCoordAttribLocation); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); glVertexAttribPointer(Shader::VertexAttribLocation, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), &mVertex[0].v.x); glVertexAttribPointer(Shader::NormalAttribLocation, 3, GL_FLOAT, @@ -146,22 +146,22 @@ } // Generate And Bind The Vertex Buffer - glGenBuffersARB(1, &mVBOVertices); // Get A Valid Name - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOVertices); // Bind The Buffer + glGenBuffers(1, &mVBOVertices); + glBindBuffer(GL_ARRAY_BUFFER, mVBOVertices); // Load The Data - glBufferDataARB(GL_ARRAY_BUFFER_ARB, mVertexQty * sizeof(Vector3f), vertex, GL_STATIC_DRAW_ARB); + glBufferData(GL_ARRAY_BUFFER, mVertexQty * sizeof(Vector3f), vertex, GL_STATIC_DRAW); // Generate And Bind The normal Buffer - glGenBuffersARB(1, &mVBONormals); // Get A Valid Name - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBONormals); // Bind The Buffer + glGenBuffers(1, &mVBONormals); + glBindBuffer(GL_ARRAY_BUFFER, mVBONormals); // Load The Data - glBufferDataARB(GL_ARRAY_BUFFER_ARB, mVertexQty * sizeof(Vector3f), normal, GL_STATIC_DRAW_ARB); + glBufferData(GL_ARRAY_BUFFER, mVertexQty * sizeof(Vector3f), normal, GL_STATIC_DRAW); // Generate And Bind The Texture Coordinate Buffer - glGenBuffersARB(1, &mVBOTexCoords); // Get A Valid Name - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOTexCoords); // Bind The Buffer + glGenBuffers(1, &mVBOTexCoords); + glBindBuffer(GL_ARRAY_BUFFER, mVBOTexCoords); // Load The Data - glBufferDataARB(GL_ARRAY_BUFFER_ARB, mVertexQty * sizeof(Texel), texel, GL_STATIC_DRAW_ARB); + glBufferData(GL_ARRAY_BUFFER, mVertexQty * sizeof(Texel), texel, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -179,11 +179,11 @@ glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOVertices); + glBindBuffer(GL_ARRAY_BUFFER, mVBOVertices); glVertexPointer(3, GL_FLOAT, 0, 0); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBONormals); + glBindBuffer(GL_ARRAY_BUFFER, mVBONormals); glNormalPointer(GL_FLOAT, 0, 0); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOTexCoords); + glBindBuffer(GL_ARRAY_BUFFER, mVBOTexCoords); glTexCoordPointer(2, GL_FLOAT, 0, 0); glDrawArrays(GL_TRIANGLES, 0, mVertexQty); @@ -202,11 +202,11 @@ glEnableVertexAttribArray(Shader::NormalAttribLocation); glEnableVertexAttribArray(Shader::TexCoordAttribLocation); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOVertices); + glBindBuffer(GL_ARRAY_BUFFER, mVBOVertices); glVertexAttribPointer(Shader::VertexAttribLocation, 3, GL_FLOAT, GL_FALSE, 0, 0); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBONormals); + glBindBuffer(GL_ARRAY_BUFFER, mVBONormals); glVertexAttribPointer(Shader::NormalAttribLocation, 3, GL_FLOAT, GL_FALSE, 0, 0); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOTexCoords); + glBindBuffer(GL_ARRAY_BUFFER, mVBOTexCoords); glVertexAttribPointer(Shader::TexCoordAttribLocation, 2, GL_FLOAT, GL_FALSE, 0, 0); glDrawArrays(GL_TRIANGLES, 0, mVertexQty); === modified file 'shader.cpp' --- shader.cpp 2010-07-09 13:34:12 +0000 +++ shader.cpp 2010-07-12 08:05:45 +0000 @@ -35,8 +35,8 @@ char *vertex_shader_source, *fragment_shader_source; char msg[512]; - mVertexShader = glCreateShaderObjectARB(GL_VERTEX_SHADER); - mFragmentShader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER); + mVertexShader = glCreateShader(GL_VERTEX_SHADER); + mFragmentShader = glCreateShader(GL_FRAGMENT_SHADER); vertex_shader_source = readShaderFile(pVertexShaderFileName); @@ -45,25 +45,25 @@ const char *vs = vertex_shader_source; const char *fs = fragment_shader_source; - glShaderSourceARB(mVertexShader, 1, &vs, NULL); - glShaderSourceARB(mFragmentShader, 1, &fs, NULL); + glShaderSource(mVertexShader, 1, &vs, NULL); + glShaderSource(mFragmentShader, 1, &fs, NULL); free(vertex_shader_source); free(fragment_shader_source); - glCompileShaderARB(mVertexShader); + glCompileShader(mVertexShader); glGetShaderInfoLog(mVertexShader, sizeof msg, NULL, msg); if (strlen(msg) > 0) printf("%s: %s", pVertexShaderFileName, msg); - glCompileShaderARB(mFragmentShader); + glCompileShader(mFragmentShader); glGetShaderInfoLog(mFragmentShader, sizeof msg, NULL, msg); if (strlen(msg) > 0) printf("%s: %s\n", pFragmentShaderFileName, msg); - mShaderProgram = glCreateProgramObjectARB(); - glAttachObjectARB(mShaderProgram, mFragmentShader); - glAttachObjectARB(mShaderProgram, mVertexShader); + mShaderProgram = glCreateProgram(); + glAttachShader(mShaderProgram, mFragmentShader); + glAttachShader(mShaderProgram, mVertexShader); glBindAttribLocation(mShaderProgram, VertexAttribLocation, "position"); glBindAttribLocation(mShaderProgram, NormalAttribLocation, "normal"); glBindAttribLocation(mShaderProgram, TexCoordAttribLocation, "texcoord"); @@ -121,22 +121,22 @@ void Shader::use() { - glUseProgramObjectARB(mShaderProgram); + glUseProgram(mShaderProgram); } void Shader::remove() { - glUseProgramObjectARB(0); + glUseProgram(0); } void Shader::unload() { - glDetachObjectARB(mShaderProgram, mVertexShader); - glDetachObjectARB(mShaderProgram, mFragmentShader); + glDetachShader(mShaderProgram, mVertexShader); + glDetachShader(mShaderProgram, mFragmentShader); - glDeleteObjectARB(mVertexShader); - glDeleteObjectARB(mFragmentShader); - glDeleteObjectARB(mShaderProgram); + glDeleteShader(mVertexShader); + glDeleteShader(mFragmentShader); + glDeleteShader(mShaderProgram); mVertexShader = 0; mFragmentShader = 0;