Skip to content

Commit

Permalink
Add missing files
Browse files Browse the repository at this point in the history
Add missing files
  • Loading branch information
MikeHart66 committed Jul 7, 2018
1 parent 5bdb30b commit 89f620a
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 73 deletions.
8 changes: 6 additions & 2 deletions modules/mojo/native/mojo.glfw.cpp
Expand Up @@ -198,10 +198,13 @@ int gxtkGraphics::Height(){
}

int gxtkGraphics::BeginRender(){

int newWidth = 0;
int newHeight = 0;

width=height=0;
#ifdef _glfw3_h_
glfwGetWindowSize( BBGlfwGame::GlfwGame()->GetGLFWwindow(),&width,&height );
glfwGetFramebufferSize( BBGlfwGame::GlfwGame()->GetGLFWwindow(),&newWidth, &newHeight );
#else
glfwGetWindowSize( &width,&height );
#endif
Expand All @@ -210,7 +213,8 @@ int gxtkGraphics::BeginRender(){
return 0;
#else

glViewport( 0,0,width,height );
//glViewport( 0,0,width,height );
glViewport( 0,0,newWidth,newHeight );

glMatrixMode( GL_PROJECTION );
glLoadIdentity();
Expand Down
2 changes: 2 additions & 0 deletions src/transcc/builders/builders.cxs
Expand Up @@ -12,6 +12,7 @@ Import stdcpp
Import winrt
Import xna
Import agk
Import agk_ios

Function Builders:StringMap<Builder>( tcc:TransCC )
Local builders:=New StringMap<Builder>
Expand All @@ -27,6 +28,7 @@ Function Builders:StringMap<Builder>( tcc:TransCC )
builders.Set "winrt",New WinrtBuilder( tcc )
builders.Set "xna",New XnaBuilder( tcc )
builders.Set "agk",New AGKBuilder( tcc )
builders.Set "agk_ios",New AGKBuilder_ios( tcc )

Return builders
End
150 changes: 83 additions & 67 deletions src/transcc/builders/ios.cxs
Expand Up @@ -222,6 +222,12 @@ Class IosBuilder Extends Builder

Method MakeTarget:Void()

Local sim_path:="/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app"
If tcc.opt_run = True
Print ("Starting iOS simulator...")
Execute "open ~q"+sim_path+"~q"
Endif

CreateDataDir "data"

Local main:=LoadString( "main.mm" )
Expand Down Expand Up @@ -260,87 +266,97 @@ Class IosBuilder Extends Builder

If Not tcc.opt_run Return

Local home:=GetEnv( "HOME" )

Local uuid:="00C69C9A-C9DE-11DF-B3BE-5540E0D72085"

' Local home:=GetEnv( "HOME" )
'
' Local uuid:="00C69C9A-C9DE-11DF-B3BE-5540E0D72085"
'
Local src:="build/"+casedConfig+"-iphonesimulator/CerberusGame.app"

Local sim_path:="/Applications/Xcode.app/Contents/Applications/iPhone Simulator.app"
If FileType( sim_path )=FILETYPE_NONE sim_path="/Applications/Xcode.app/Contents/Developer/Builders/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app"
'Local sim_path:="/Applications/Xcode.app/Contents/Applications/iPhone Simulator.app"
' If FileType( sim_path )=FILETYPE_NONE sim_path="/Applications/Xcode.app/Contents/Developer/Builders/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app"
'If FileType( sim_path )=FILETYPE_NONE sim_path="/Applications/Xcode.app/Contents/Developer/Builders/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app"

'New XCode in /Applications?
If FileType( sim_path )=FILETYPE_DIR

Local dst:=""

For Local f:=Eachin LoadDir( home+"/Library/Application Support/iPhone Simulator" )

If f.Length>2 And f[0]>48 And f[0]<58 And f[1]=46 And f[2]>=48 And f[2]<58 And Not f.Contains( "-64" ) And f>dst dst=f

'X.Y?
'If f.Length=3 And f[0]>48 And f[0]<58 And f[1]=46 And f[2]>=48 And f[2]<58 And Float(f)>Float(dst) dst=f
Next
If Not dst Die "Can't find iPhone simulator app version dir"
Print ("Installing GerberusGame.app")
Execute ("xcrun simctl install booted ~q"+src+"~q")

dst=home+"/Library/Application Support/iPhone Simulator/"+dst+"/Applications"
Print ("Running CerberusGame.app")
Execute "xcrun simctl launch booted com.yourcompany.CerberusGame"

CreateDir dst
If FileType( dst )<>FILETYPE_DIR Die "Failed to create dir:"+dst

dst+="/"+uuid
If Not DeleteDir( dst,True ) Die "Failed to delete dir:"+dst
If Not CreateDir( dst ) Die "Failed to create dir:"+dst

'Need to use this 'coz it does the permissions thang
'
Execute "cp -r ~q"+src+"~q ~q"+dst+"/CerberusGame.app~q"

'Have to manually create documents dir for Cerberus://internal/?
'
CreateDir dst+"/Documents"

' Local dst:=""
'
' For Local f:=Eachin LoadDir( home+"/Library/Application Support/iPhone Simulator" )
'
' If f.Length>2 And f[0]>48 And f[0]<58 And f[1]=46 And f[2]>=48 And f[2]<58 And Not f.Contains( "-64" ) And f>dst dst=f
'
' 'X.Y?
' 'If f.Length=3 And f[0]>48 And f[0]<58 And f[1]=46 And f[2]>=48 And f[2]<58 And Float(f)>Float(dst) dst=f
' Next
' If Not dst Die "Can't find iPhone simulator app version dir"
'
' dst=home+"/Library/Application Support/iPhone Simulator/"+dst+"/Applications"
'
' CreateDir dst
' If FileType( dst )<>FILETYPE_DIR Die "Failed to create dir:"+dst
'
' dst+="/"+uuid
' If Not DeleteDir( dst,True ) Die "Failed to delete dir:"+dst
' If Not CreateDir( dst ) Die "Failed to create dir:"+dst
'
' 'Need to use this 'coz it does the permissions thang
' '
' Execute "cp -r ~q"+src+"~q ~q"+dst+"/CerberusGame.app~q"
'
' 'Have to manually create documents dir for Cerberus://internal/?
' '
' CreateDir dst+"/Documents"
'
' 're-start emulator
' '
' 'Execute "killall ~qiPhone Simulator~q 2>/dev/null",False
' Execute "killall ~qSimulator~q 2>/dev/null",False

're-start emulator
'
Execute "killall ~qiPhone Simulator~q 2>/dev/null",False
Execute "open ~q"+sim_path+"~q"


Return

Endif

'Old xcode in /Developer
sim_path="/Developer/Builders/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app"

If FileType( sim_path )=FILETYPE_DIR

Local dst:=home+"/Library/Application Support/iPhone Simulator/4.3.2"
If FileType( dst )=FILETYPE_NONE
dst=home+"/Library/Application Support/iPhone Simulator/4.3"
If FileType( dst )=FILETYPE_NONE
dst=home+"/Library/Application Support/iPhone Simulator/4.2"
Endif
Endif

CreateDir dst
dst+="/Applications"
CreateDir dst
dst+="/"+uuid
If Not DeleteDir( dst,True ) Die "Failed to delete dir:"+dst
If Not CreateDir( dst ) Die "Failed to create dir:"+dst

'Need to use this 'coz it does the permissions thang
'
Execute "cp -r ~q"+src+"~q ~q"+dst+"/CerberusGame.app~q"

're-start emulator
'
Execute "killall ~qiPhone Simulator~q 2>/dev/null",False
Execute "open ~q"+sim_path+"~q"

Return

Endif
' 'Old xcode in /Developer
' sim_path="/Developer/Builders/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app"
'
' If FileType( sim_path )=FILETYPE_DIR
'
' Local dst:=home+"/Library/Application Support/iPhone Simulator/4.3.2"
' If FileType( dst )=FILETYPE_NONE
' dst=home+"/Library/Application Support/iPhone Simulator/4.3"
' If FileType( dst )=FILETYPE_NONE
' dst=home+"/Library/Application Support/iPhone Simulator/4.2"
' Endif
' Endif
'
' CreateDir dst
' dst+="/Applications"
' CreateDir dst
' dst+="/"+uuid
' If Not DeleteDir( dst,True ) Die "Failed to delete dir:"+dst
' If Not CreateDir( dst ) Die "Failed to create dir:"+dst
'
' 'Need to use this 'coz it does the permissions thang
' '
' Execute "cp -r ~q"+src+"~q ~q"+dst+"/CerberusGame.app~q"
'
' 're-start emulator
' '
' Execute "killall ~qiPhone Simulator~q 2>/dev/null",False
' Execute "open ~q"+sim_path+"~q"
'
' Return
'
' Endif

End
End
Expand Down
4 changes: 2 additions & 2 deletions targets/appgamekit/tools/AGKBuildTarget.cxs
Expand Up @@ -301,8 +301,8 @@ Function Main:Int()
Next

Local outs2:String
outs2 += "#If TARGET<>~qagk~q~n"
outs2 += "#Error ~qInvalid target. Please select Desktop (AppGameKit)!~q~n"
outs2 += "#If TARGET<>~qagk~q And TARGET<>~qagk_ios~q~n"
outs2 += "#Error ~qInvalid target!~q~n"
outs2 += "#Endif~n"
outs2 += "Import ~qnative/agk2.cpp~q~n"

Expand Down
9 changes: 7 additions & 2 deletions targets/appgamekit/tools/agk2_help.txt
@@ -1,6 +1,11 @@
The agk2 module is a wrapper for [AppGameKit](https://www.appgamekit.com) by [TheGameCreators](https://www.thegamecreators.com).

To use it, you need to own AppGameKit and have the AGK_PATH variable set inside the bin/config file of your platform. Currently only Windows Desktop is supported as a target platform.
To use it, you need to own AppGameKit and have the AGK_PATH variable set inside the bin/config file of your platform.
Currently the following platforms are supported as a target platforms for AGK:

* Windows
* OSX
* iOS

For more details about the AGK API, please consult its [official documentation](https://www.appgamekit.com/documentation/home.html). This help file is just a quick solution to give you an inbuild quick help.

Expand Down Expand Up @@ -62,6 +67,6 @@ End

>> Media / Assets

All your assets have to be stored inside the usual CX data folder. To access them when loading, just add a "data/" prefix to your filepath.
All your assets have to be stored inside a media folder. To access them when loading, just add a "media/" prefix to your filepath.

>> Below are the categories of the AppgameKit API
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit 89f620a

Please sign in to comment.