Skip to content

Commit

Permalink
gles2 samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepan Kopylov committed Oct 8, 2019
1 parent ec5785d commit 98e2544
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
/* Begin PBXBuildFile section */
6A00F00F1CD0C26700DF53D2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A00F00E1CD0C26700DF53D2 /* main.m */; };
6A00F0121CD0C26700DF53D2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A00F0111CD0C26700DF53D2 /* AppDelegate.m */; };
6A00F0151CD0C26700DF53D2 /* CubeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A00F0141CD0C26700DF53D2 /* CubeViewController.m */; };
6A00F0151CD0C26700DF53D2 /* CubeGL2ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A00F0141CD0C26700DF53D2 /* CubeGL2ViewController.m */; };
6A00F0181CD0C26700DF53D2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6A00F0161CD0C26700DF53D2 /* Main.storyboard */; };
6A00F01A1CD0C26700DF53D2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6A00F0191CD0C26700DF53D2 /* Assets.xcassets */; };
6A00F01D1CD0C26700DF53D2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6A00F01B1CD0C26700DF53D2 /* LaunchScreen.storyboard */; };
6A00F0311CD1201300DF53D2 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A00F0301CD1201300DF53D2 /* ViewController.m */; };
6A00F0311CD1201300DF53D2 /* MultipleInstancesGL2ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A00F0301CD1201300DF53D2 /* MultipleInstancesGL2ViewController.m */; };
6A71C29A1CD13980004320A9 /* SimpleVertex.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 6A71C2991CD13980004320A9 /* SimpleVertex.glsl */; };
6A71C29C1CD13A4F004320A9 /* SimpleFragment.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 6A71C29B1CD13A4F004320A9 /* SimpleFragment.glsl */; };
6A71C2A91CD13E9B004320A9 /* CC3Foundation.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A71C2A01CD13E9B004320A9 /* CC3Foundation.m */; };
Expand All @@ -33,14 +33,14 @@
6A00F00E1CD0C26700DF53D2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
6A00F0101CD0C26700DF53D2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
6A00F0111CD0C26700DF53D2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
6A00F0131CD0C26700DF53D2 /* CubeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CubeViewController.h; sourceTree = "<group>"; };
6A00F0141CD0C26700DF53D2 /* CubeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CubeViewController.m; sourceTree = "<group>"; };
6A00F0131CD0C26700DF53D2 /* CubeGL2ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CubeGL2ViewController.h; sourceTree = "<group>"; };
6A00F0141CD0C26700DF53D2 /* CubeGL2ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CubeGL2ViewController.m; sourceTree = "<group>"; };
6A00F0171CD0C26700DF53D2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
6A00F0191CD0C26700DF53D2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6A00F01C1CD0C26700DF53D2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6A00F01E1CD0C26700DF53D2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6A00F02F1CD1201300DF53D2 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
6A00F0301CD1201300DF53D2 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
6A00F02F1CD1201300DF53D2 /* MultipleInstancesGL2ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MultipleInstancesGL2ViewController.h; sourceTree = "<group>"; };
6A00F0301CD1201300DF53D2 /* MultipleInstancesGL2ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MultipleInstancesGL2ViewController.m; sourceTree = "<group>"; };
6A71C2991CD13980004320A9 /* SimpleVertex.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SimpleVertex.glsl; sourceTree = "<group>"; };
6A71C29B1CD13A4F004320A9 /* SimpleFragment.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SimpleFragment.glsl; sourceTree = "<group>"; };
6A71C29F1CD13E9B004320A9 /* CC3Foundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CC3Foundation.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -171,10 +171,10 @@
children = (
6A71C2B51CD21489004320A9 /* BasicViewController.h */,
6A71C2B61CD21489004320A9 /* BasicViewController.m */,
6A00F0131CD0C26700DF53D2 /* CubeViewController.h */,
6A00F0141CD0C26700DF53D2 /* CubeViewController.m */,
6A00F02F1CD1201300DF53D2 /* ViewController.h */,
6A00F0301CD1201300DF53D2 /* ViewController.m */,
6A00F0131CD0C26700DF53D2 /* CubeGL2ViewController.h */,
6A00F0141CD0C26700DF53D2 /* CubeGL2ViewController.m */,
6A00F02F1CD1201300DF53D2 /* MultipleInstancesGL2ViewController.h */,
6A00F0301CD1201300DF53D2 /* MultipleInstancesGL2ViewController.m */,
);
name = ViewControllers;
sourceTree = "<group>";
Expand Down Expand Up @@ -231,6 +231,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -313,11 +314,11 @@
buildActionMask = 2147483647;
files = (
6A71C2AB1CD13E9B004320A9 /* CC3Kazmath.c in Sources */,
6A00F0311CD1201300DF53D2 /* ViewController.m in Sources */,
6A00F0311CD1201300DF53D2 /* MultipleInstancesGL2ViewController.m in Sources */,
6A71C2B31CD21039004320A9 /* SKBaseAsyncGLViewController.m in Sources */,
6A71C2B21CD21039004320A9 /* SKAsyncGLView.m in Sources */,
7916229A1E80144400D14255 /* SKAntialiasedAsyncGLViewController.m in Sources */,
6A00F0151CD0C26700DF53D2 /* CubeViewController.m in Sources */,
6A00F0151CD0C26700DF53D2 /* CubeGL2ViewController.m in Sources */,
6A00F0121CD0C26700DF53D2 /* AppDelegate.m in Sources */,
6A71C2A91CD13E9B004320A9 /* CC3Foundation.m in Sources */,
6A00F00F1CD0C26700DF53D2 /* main.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="nQ8-2D-0cU">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="9Wg-8Y-WIc">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
Expand All @@ -25,10 +25,10 @@
</objects>
<point key="canvasLocation" x="1236" y="-282"/>
</scene>
<!--Cube View Controller-->
<!--CubeGL2 View Controller-->
<scene sceneID="own-EE-CTQ">
<objects>
<viewController id="nQ8-2D-0cU" customClass="CubeViewController" sceneMemberID="viewController">
<viewController id="nQ8-2D-0cU" customClass="CubeGL2ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="sQC-bb-vKz"/>
<viewControllerLayoutGuide type="bottom" id="bCL-6L-I3h"/>
Expand All @@ -46,7 +46,7 @@
<!--Title-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="MultipleInstancesGL2ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
Expand Down Expand Up @@ -133,7 +133,7 @@
<rect key="frame" x="0.0" y="0.0" width="348" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Cube" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1pa-Rq-5Td">
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Cube OpenGLES2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1pa-Rq-5Td">
<rect key="frame" x="16" y="0.0" width="324" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
Expand All @@ -153,7 +153,7 @@
<rect key="frame" x="0.0" y="0.0" width="348" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Multiple instances" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="wnM-Ho-dSc">
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Multiple instances OpenGLES2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="wnM-Ho-dSc">
<rect key="frame" x="16" y="0.0" width="324" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "SKAntialiasedAsyncGLViewController.h"

@interface CubeViewController : SKAntialiasedAsyncGLViewController
@interface CubeGL2ViewController : SKAntialiasedAsyncGLViewController

@property (nonatomic) BOOL floating;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Stephen Kopylov - Home on 27/04/16.
// Copyright © 2016 test. All rights reserved.
//
#import "CubeViewController.h"
#import "CubeGL2ViewController.h"
#import <OpenGLES/ES2/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES3/gl.h>
Expand Down Expand Up @@ -48,7 +48,7 @@
0, 7, 4
};

@interface CubeViewController ()
@interface CubeGL2ViewController ()

@property (nonatomic) GLuint positionSlot;
@property (nonatomic) GLuint colorSlot;
Expand All @@ -71,7 +71,7 @@ @interface CubeViewController ()

@end

@implementation CubeViewController
@implementation CubeGL2ViewController

#pragma mark - Lifecycle

Expand Down Expand Up @@ -275,5 +275,8 @@ - (void)clearGL
}
}

-(EAGLRenderingAPI)getApi{
return kEAGLRenderingAPIOpenGLES2;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController
@interface MultipleInstancesGL2ViewController : UIViewController

@end
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
#define boris_random(smallNumber, bigNumber) ((((float)(arc4random() % ((unsigned)RAND_MAX + 1)) / RAND_MAX) * (bigNumber - smallNumber)) + smallNumber)
#define SIDE 150.0f

#import "ViewController.h"
#import "CubeViewController.h"
#import "MultipleInstancesGL2ViewController.h"
#import "CubeGL2ViewController.h"

@interface ViewController ()
@interface MultipleInstancesGL2ViewController ()

@end

@implementation ViewController {
@implementation MultipleInstancesGL2ViewController {
}

- (void)viewDidLoad
Expand All @@ -29,7 +29,7 @@ - (void)viewDidLoad

- (IBAction)buttonTapped:(id)sender
{
CubeViewController *vc = [CubeViewController new];
CubeGL2ViewController *vc = [CubeGL2ViewController new];

vc.floating = YES;
[self addChildViewController:vc];
Expand All @@ -44,5 +44,4 @@ - (IBAction)buttonTapped:(id)sender
}];
}


@end

0 comments on commit 98e2544

Please sign in to comment.