Commit f7374eda authored by abarth@chromium.org's avatar abarth@chromium.org

Add a SpinningCube to Mojo's sample_app

We don't actually call this code yet, but we're going to need this code in
order to demo a spinning cube. I've verified that this code draws a cube when
called directly from mojo_shell. It should work when called from sample_app
once we figure out how we want to expose GL to Mojo apps.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/61423003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233309 0039d316-1c4b-4281-b951-d872f2087c98
parent 582d12b0
include_rules = [
# TODO(abarth): Rather than including this interface directly,
# we need to figure out the right way for apps to call GL.
"!gpu/command_buffer/client/gles2_interface.h",
]
This diff is collapsed.
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_
#define MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_
#include "base/memory/scoped_ptr.h"
namespace gpu {
namespace gles2 {
class GLES2Interface;
}
}
namespace mojo {
namespace examples {
class SpinningCube {
public:
SpinningCube();
~SpinningCube();
void BindTo(gpu::gles2::GLES2Interface* gl,
int width,
int height);
void OnGLContextLost();
void Update(float delta_time);
void Draw();
private:
class GLState;
gpu::gles2::GLES2Interface* gl_;
int width_;
int height_;
scoped_ptr<GLState> state_;
};
} // namespace examples
} // namespace mojo
#endif // MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_
......@@ -231,10 +231,13 @@
'target_name': 'sample_app',
'type': 'shared_library',
'dependencies': [
'../ui/gl/gl.gyp:gl',
'mojo_system',
],
'sources': [
'examples/sample_app/sample_app.cc',
'examples/sample_app/spinning_cube.cc',
'examples/sample_app/spinning_cube.h',
],
},
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment