Skip to content

Commit

Permalink
Bug for jomof
Browse files Browse the repository at this point in the history
  • Loading branch information
DanAlbert committed May 16, 2024
1 parent 3685622 commit ba68d47
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
1 change: 1 addition & 0 deletions graphics/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ add_library(app
android_main.cpp
engine.cpp
logging.cpp
renderer.cpp
)

target_link_libraries(app
Expand Down
5 changes: 3 additions & 2 deletions graphics/src/main/cpp/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@

#include "game-activity/native_app_glue/android_native_app_glue.h"

#include "macros.h"

namespace ndksamples::graphics {

class Engine {
public:
Engine(android_app* _Nonnull app);
Engine(const Engine&) = delete;
virtual ~Engine();

Engine& operator=(const Engine&) = delete;
DISALLOW_COPY_AND_ASSIGN(Engine);

void Run();

Expand Down
25 changes: 25 additions & 0 deletions graphics/src/main/cpp/renderer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "renderer.h"

namespace ndksamples::graphics {

Renderer::Renderer(const android_app* _Nonnull app) : app_(app) {}

Renderer::~Renderer() {}

} // namespace ndksamples::graphics
41 changes: 41 additions & 0 deletions graphics/src/main/cpp/renderer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include "game-activity/native_app_glue/android_native_app_glue.h"

#include "macros.h"

namespace ndksamples::graphics {

class Renderer {
public:
Renderer(const android_app* _Nonnull app);
virtual ~Renderer();

DISALLOW_COPY_AND_ASSIGN(Renderer);

void AttachWindow();
void DetachWindow();

void DrawFrame();

private:
const android_app* _Nonnull app_;
};

} // namespace ndksamples::graphics

0 comments on commit ba68d47

Please sign in to comment.