Permalink
Browse files

SDL is deprecated, used PC

  • Loading branch information...
1 parent 967bd5e commit 34b0f871f994f69d663495072cf0055aa1fd36a0 @serp256 committed Aug 3, 2012
View
@@ -1,6 +1,6 @@
export PLATFORM = ANDROID
OCAMLDIR = /usr/local/ocaml/android
-export OCAMLFIND = /usr/local/bin/ocamlfind -toolchain android
+export OCAMLFIND = ocamlfind -toolchain android
OCAMLBINDIR = $(OCAMLDIR)/bin/
export OCAMLOPT = $(OCAMLFIND) ocamlopt
export OCAMLC = $(OCAMLFIND) ocamlc
View
@@ -1,5 +1,4 @@
--include myconfig.macos
-export PLATFORM = SDL
+export PLATFORM = PC
export OS = macos
SDK = /Developer/SDKs/MacOSX10.7.sdk
export OCAMLFIND ?= ocamlfind
@@ -8,5 +7,4 @@ export CFLAGS = -std=c99 -Wno-trigraphs -fpascal-strings -O0 -DDEBUG -Wreturn-ty
export OCAMLOPT = $(OCAMLFIND) ocamlopt
export OCAMLC = $(OCAMLFIND) ocamlc
export OCAMLMKLIB ?= ocamlmklib
-export SDLCONFIG ?= sdl-config
-LIB = byte syntax
+LIB = byte native syntax
View
@@ -189,7 +189,7 @@ value read_json ?(with_suffix=True) path =
];
-ELSE IFDEF SDL THEN
+ELSE IFDEF PC THEN
value resources_path = "Resources";
value resource_path ?(with_suffix=True) fname =
View
@@ -44,7 +44,7 @@ type deviceType = [ Phone | Pad ];
value deviceType: unit -> deviceType;
-IFDEF SDL THEN
+IFDEF PC THEN
value internalDeviceType: ref deviceType;
ENDIF;
View
@@ -45,10 +45,10 @@ type stage_constructor = float -> float -> Stage.c;
(* value _stage: ref (option (float -> float -> stage eventTypeDisplayObject eventEmptyData)) = ref None; *)
-IFDEF SDL THEN
+IFDEF PC THEN
value init s =
let s = (s :> stage_constructor) in
- Sdl_run.run s;
+ Pc_run.run s;
ELSE
value _stage : ref (option stage_constructor) = ref None;
@@ -75,7 +75,7 @@ value () =
ENDIF;
-IFDEF SDL THEN
+IFDEF PC THEN
value getLocale () = "en";
ELSE
external getLocale: unit -> string = "ml_getLocale";
View
@@ -14,6 +14,7 @@ render_stub.o: light_common.h texture_common.h render_stub.h
filters_stub.o: light_common.h texture_common.h render_stub.h
ios/texture_ios.o: texture_common.h
sdl/texture_sdl.o: texture_common.h
+glut/texture_glut.o: texture_common.h
android/texture_android.o: texture_common.h
MLOBJSFLAGS =
@@ -56,9 +57,18 @@ ifeq ($(PLATFORM),IOS)
GLPARAM = -D__ANDROID__
LIBFLAGS = -cclib '-lGLESv2' -cclib '-llog' -cclib '-lz' -cclib '-lpng' -cclib '-ljpeg' -cclib '-lcurl'
else
- ifeq ($(PLATFORM),GLUT)
- MOBJS += glut/glut_stub.o
- BMLSOURCES = glut/glut.ml
+ ifeq ($(PLATFORM),PC)
+ MOBJS += net_curl.o pc/glut_stub.o texture_load.o pc/texture_pc.o
+ BMLSOURCES = pc/glut.ml
+ AMLSOURCES = pc/pc_run.ml
+ MLOBJSFLAGS = -I pc
+ ifeq ($(OS),macos)
+ LIBFLAGS = $(patsubst %,-ccopt %,${SDLFLAGS}) -framework Cocoa -framework OpenGL -framework GLUT
+ else
+ LIBFLAGS = $(patsubst %,-ccopt %,${SDLFLAGS}) -cclib '-lGL'
+ endif
+ LIBFLAGS += -lcurl -lpng -ljpeg
+ GLPARAM = -DGL_GLEXT_PROTOTYPES -fPIC
else
CFLAGS += $(shell ${SDLCONFIG} --cflags)
MOBJS += net_curl.o sdl/sdl_stub.o sdl/sdl_image_stub.o sdl/texture_sdl.o
@@ -147,7 +157,6 @@ MLDepend.$(PLATFORM):
$(OCAMLFIND) ocamldep $(MLDEPFLAGS) $(MLFLAGS) -I containers $(MLCONTAINERS:.ml=.mli) $(MLCONTAINERS) > MLDepend.$(PLATFORM)
$(OCAMLFIND) ocamldep $(MLDEPFLAGS) $(MLFLAGS) -I containers -I utils $(MLUTILS:.ml=.mli) $(MLUTILS) >> MLDepend.$(PLATFORM)
$(OCAMLFIND) ocamldep $(MLDEPFLAGS) $(MLFLAGS) $(MLOBJSFLAGS) $(if $(MLPPOPT),$(patsubst %,-ppopt %,$(MLPPOPT))) $(MLSOURCES:.ml=.mli) RenderFilters.ml $(MLSOURCES) >> MLDepend.$(PLATFORM)
-# $(OCAMLFIND) ocamldep $(MLFLAGS) -I $(gl) $(MLOBJSFLAGS) $(if $(MLPPOPT),$(patsubst %,-ppopt %,$(MLPPOPT))) *.mli $(MLSOURCES) >> MLDepend.$(PLATFORM)
doc:
@@ -161,6 +170,6 @@ doc:
.PHONY : clean
clean:
- rm -f *.o *.cm[iox] *.a *.cmxa *.so *.cmo ios/*.o sdl/*.cmx sdl/*.cmo sdl/*.o sdl/*.cmi containers/*.cmi containers/*.cmx containers/*.cmo containers/*.o $(gl)/*.o $(gl)/*.cmx $(gl)/*.cmi *.html *.css MLDepend.* syntax/*.cmo syntax/*.cmi utils/*.cmi utils/*.cmx utils/*.cmo utils/*.a kazmath/*.o kazmath/GL/*.o android/*.o
+ rm -f *.o *.cm[iox] *.a *.cmxa *.so *.cmo ios/*.o glut/*.cmx glut.*.cmo glut/*.o glut/*.cmi sdl/*.cmx sdl/*.cmo sdl/*.o sdl/*.cmi containers/*.cmi containers/*.cmx containers/*.cmo containers/*.o $(gl)/*.o $(gl)/*.cmx $(gl)/*.cmi *.html *.css MLDepend.* syntax/*.cmo syntax/*.cmi utils/*.cmi utils/*.cmx utils/*.cmo utils/*.a kazmath/*.o kazmath/GL/*.o android/*.o
-include MLDepend.$(PLATFORM)
View
@@ -21,16 +21,6 @@ external setupOrthographicRendering: float -> float -> float -> float -> unit =
exception Restricted_operation;
-(*
-IFDEF IOS
-THEN
-external uncatchedError: string -> unit = "ml_uncatchedError";
-DEFINE CATCH_ALL(expr) =
- try expr with [ exn -> uncatchedError (Printexc.to_string exn) ];
-ELSE
-*)
-DEFINE CATCH_ALL(expr) = expr;
-(* ENDIF; *)
module D = DisplayObject;
@@ -229,24 +219,22 @@ class virtual c (_width:float) (_height:float) =
method advanceTime (seconds:float) =
(
- let () = debug "advance time: %f" seconds in
- CATCH_ALL begin
- Texture.check_async();
- proftimer:perfomance "Stage advanceTime: %F"
- (
- Timers.process seconds;
- Queue.transfer tweens runtweens;
- while not (Queue.is_empty runtweens) do
- let tween = Queue.take runtweens in
- match tween#process seconds with
- [ True -> Queue.push tween tweens
- | False -> ()
- ]
- done;
- );
- proftimer:perfomance "Enter frame: %F" D.dispatchEnterFrame seconds;
- debug "end advance time";
- end
+ debug "advance time: %f" seconds;
+ Texture.check_async();
+ proftimer:perfomance "Stage advanceTime: %F"
+ (
+ Timers.process seconds;
+ Queue.transfer tweens runtweens;
+ while not (Queue.is_empty runtweens) do
+ let tween = Queue.take runtweens in
+ match tween#process seconds with
+ [ True -> Queue.push tween tweens
+ | False -> ()
+ ]
+ done;
+ );
+ proftimer:perfomance "Enter frame: %F" D.dispatchEnterFrame seconds;
+ debug "end advance time";
);
method !z = Some 0;
Oops, something went wrong.

0 comments on commit 34b0f87

Please sign in to comment.