File: testbin.erl

package info (click to toggle)
esdl 1.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,312 kB
  • ctags: 7,213
  • sloc: ansic: 13,621; erlang: 8,825; makefile: 294; sh: 228; objc: 181
file content (40 lines) | stat: -rwxr-xr-x 1,299 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
%%  Copyright (c) 2001 Dan Gudmundsson
%%  See the file "license.terms" for information on usage and redistribution
%%  of this file, and for a DISCLAIMER OF ALL WARRANTIES.
%% 
%%     $Id$
%%
%%%----------------------------------------------------------------------
%%% File    : testbin.erl
%%% Author  : Dan Gudmundsson <dgud@erix.ericsson.se>
%%% Purpose : 
%%% Created : 12 Sep 2000 by Dan Gudmundsson <dgud@erix.ericsson.se>
%%%----------------------------------------------------------------------

-module(testbin).
-author('dgud@erix.ericsson.se').

-compile(export_all).
%%-export([Function/Arity, ...]).
-include("sdl.hrl").
-include("gl.hrl").

init() ->
    go().

go() ->
    Wrapper = sdl:init(?SDL_INIT_VIDEO),
    io:format("Wrapper ~p~n", [Wrapper]),    
    F32 = sdl_util:malloc(7, ?GL_FLOAT),
    F64 = sdl_util:malloc(7, ?GL_DOUBLE),
    Args = [0.0, 1.0, 1000000.0, 0.000001, -1.0, -1000000.0, -0.000001],
    io:format("E Writing ~f ~f ~f ~f ~f ~f ~f~n", Args),
    sdl_util:write(F32, Args),
    sdl_util:write(F64, Args),
    io:format("Reading~n"),
    
    List32 = sdl_util:read(F32, length(Args)),
    io:format("E Read32 ~f ~f ~f ~f ~f ~f ~f~n", List32),
    List64 = sdl_util:read(F64, length(Args)),
    io:format("E Read64 ~f ~f ~f ~f ~f ~f ~f~n", List64),
    ok.