From patchwork Thu Jul 21 12:36:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandros Frantzis X-Patchwork-Id: 3010 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 068CA23F4D for ; Thu, 21 Jul 2011 12:44:43 +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 C97FFA184F2 for ; Thu, 21 Jul 2011 12:44:42 +0000 (UTC) Received: by mail-qw0-f52.google.com with SMTP id 8so853237qwb.11 for ; Thu, 21 Jul 2011 05:44:42 -0700 (PDT) Received: by 10.229.68.200 with SMTP id w8mr192593qci.114.1311252282551; Thu, 21 Jul 2011 05:44:42 -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 hl14cs139607qcb; Thu, 21 Jul 2011 05:44:42 -0700 (PDT) Received: by 10.216.202.79 with SMTP id c57mr770265weo.21.1311251795274; 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 s68si2401461weq.25.2011.07.21.05.36.34; 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-0000DA-C3 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 C7D8D2EA03D for ; Thu, 21 Jul 2011 12:36:31 +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: 26 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 26: Add Mesh:render_array_attrib() method. Message-Id: <20110721123631.17019.27876.launchpad@loganberry.canonical.com> Date: Thu, 21 Jul 2011 12:36:31 -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: fd90f0569299de284f066157d2695343547bc00b ------------------------------------------------------------ revno: 26 committer: Alexandros Frantzis timestamp: Fri 2010-07-09 13:13:39 +0300 message: Add Mesh:render_array_attrib() method. modified: mesh.cpp mesh.h --- 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-08 08:34:51 +0000 +++ mesh.cpp 2010-07-09 10:13:39 +0000 @@ -146,6 +146,29 @@ glDisableClientState(GL_NORMAL_ARRAY); } +void Mesh::render_array_attrib() +{ + // Enable the attributes + glEnableVertexAttribArray(Shader::VertexAttribLocation); + glEnableVertexAttribArray(Shader::NormalAttribLocation); + glEnableVertexAttribArray(Shader::TexCoordAttribLocation); + + glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glVertexAttribPointer(Shader::VertexAttribLocation, 3, GL_FLOAT, + GL_FALSE, sizeof(Vertex), &mVertex[0].v.x); + glVertexAttribPointer(Shader::NormalAttribLocation, 3, GL_FLOAT, + GL_FALSE, sizeof(Vertex), &mVertex[0].n.x); + glVertexAttribPointer(Shader::TexCoordAttribLocation, 2, GL_FLOAT, + GL_FALSE, sizeof(Vertex), &mVertex[0].t.u); + + glDrawArrays(GL_TRIANGLES, 0, mVertexQty); + + // Disable the attributes + glDisableVertexAttribArray(Shader::TexCoordAttribLocation); + glDisableVertexAttribArray(Shader::NormalAttribLocation); + glDisableVertexAttribArray(Shader::VertexAttribLocation); +} + void Mesh::build_vbo() { #ifdef _DEBUG === modified file 'mesh.h' --- mesh.h 2010-07-08 08:34:51 +0000 +++ mesh.h 2010-07-09 10:13:39 +0000 @@ -44,6 +44,7 @@ void make_cube(); void make_torus(); void render_array(); + void render_array_attrib(); void build_vbo(); void render_vbo(); void render_vbo_attrib();