FPLBase
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
renderer_android.h
Go to the documentation of this file.
1 // Copyright 2014 Google Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef FPLBASE_RENDERER_ANDROID_H
16 #define FPLBASE_RENDERER_ANDROID_H
17 
18 #include "fplbase/config.h" // Must come first.
19 
20 namespace fplbase {
21 
22 /// @file
23 /// @addtogroup fplbase_renderer
24 /// @{
25 
26 #ifdef __ANDROID__
27 /// @brief Create the Android window surface.
29 
30 /// @brief Scalar settings can occasionally fail on fail on some Android
31 /// devices. In failure cases, the caller can check for success by
32 /// verifying `AndroidGetScalerResolution()` returns the expected resolution.
33 /// If `AndroidGetScalarResolution()` returns a diffrent resolution than what
34 /// was set in `AndroidSetScaleResolution()`, the application can assume
35 /// failure and attempt to restart the app to try configuration again.
36 /// @param[in] resolution A const `mathfu::vec2i` reference to the scaler
37 /// resolution to set for the Android device.
38 void AndroidSetScalerResolution(const mathfu::vec2i& resolution);
39 
40 /// @brief Get the Android scaler resolution.
41 /// @return Returns the Android scaler resolution as a const `mathfu::vec2i`
42 /// reference.
43 const mathfu::vec2i& AndroidGetScalerResolution();
44 
45 /// @brief Gets the GLES client version of the current EGL context.
46 /// @return Returns the GLES client version of the current EGL context.
48 
49 /// @brief Gets all the GL3 function pointers. Using this rather than
50 /// GLES3/gl3.h directly means we can still compile on older SDKs and run on
51 /// older devices too.
53 #endif
54 
55 /// @}
56 } // namespace fplbase
57 
58 #endif // FPLBASE_RENDERER_ANDROID_H
void AndroidPreCreateWindow()
Create the Android window surface.
void AndroidSetScalerResolution(const mathfu::vec2i &resolution)
Scalar settings can occasionally fail on fail on some Android devices. In failure cases...
void AndroidInitGl3Functions()
Gets all the GL3 function pointers. Using this rather than GLES3/gl3.h directly means we can still co...
int AndroidGetContextClientVersion()
Gets the GLES client version of the current EGL context.
const mathfu::vec2i & AndroidGetScalerResolution()
Get the Android scaler resolution.