Browse Source

read .OBJ file, first try

tonton th 5 months ago
parent
commit
5a6e98d034
7 changed files with 65 additions and 2 deletions
  1. 4
    0
      .gitignore
  2. 4
    1
      Makefile
  3. 1
    1
      bubulles.h
  4. 0
    0
      doc/tricks.txt
  5. 26
    0
      importobj.c
  6. 5
    0
      tools/Makefile
  7. 25
    0
      tools/read_obj.c

+ 4
- 0
.gitignore View File

@@ -5,3 +5,7 @@ libbubulles.a
5 5
 tbb
6 6
 gmon.out
7 7
 dummy-file
8
+
9
+tools/covid-19.obj
10
+tools/read_obj
11
+

+ 4
- 1
Makefile View File

@@ -12,12 +12,15 @@ CC = gcc
12 12
 
13 13
 OPT = -Wall -g -DDEBUG_LEVEL=0 -DMUST_ABORT
14 14
 
15
-libbubulles.a:	bubulles.o
15
+libbubulles.a:	bubulles.o importobj.o
16 16
 	ar r $@ $?
17 17
 
18 18
 bubulles.o:	bubulles.c bubulles.h Makefile
19 19
 	$(CC) $(OPT) -c $< 
20 20
 
21
+importobj.o:	importobj.c bubulles.h Makefile
22
+	$(CC) $(OPT) -c $< 
23
+
21 24
 # ------------------------------------------------
22 25
 # --- build some tests and tools
23 26
 

+ 1
- 1
bubulles.h View File

@@ -4,7 +4,7 @@
4 4
 
5 5
 /* --------------------------------------------------------------------- */
6 6
 
7
-#define LIBBB_VERSION		52
7
+#define LIBBB_VERSION		53
8 8
 
9 9
 #define SZ_BUBULLE_TEXT		51		/* arbitrary value */
10 10
 

+ 0
- 0
doc/tricks.txt View File


+ 26
- 0
importobj.c View File

@@ -0,0 +1,26 @@
1
+/*
2
+	          LIBBUBULLES
3
+
4
+	some functions for importing bubulles from dot-OBJ files.
5
+*/
6
+
7
+#include  <stdio.h>
8
+#include  <stdlib.h>
9
+#include  <string.h>
10
+
11
+#include  "bubulles.h"
12
+
13
+/* --------------------------------------------------------------------- */
14
+
15
+int try_to_read_an_OBJ_file(char *fname, int notused)
16
+{
17
+FILE		*fpin;
18
+
19
+#if DEBUG_LEVEL
20
+fprintf(stderr, ">>> %s ( '%s' %d)\n", fname, notused);
21
+#endif
22
+
23
+return -7800;
24
+}
25
+
26
+/* --------------------------------------------------------------------- */

+ 5
- 0
tools/Makefile View File

@@ -0,0 +1,5 @@
1
+
2
+BBFUNCS = ../libbubulles.a 
3
+
4
+read_obj:	read_obj.c Makefile ${BBFUNCS}
5
+	gcc -Wall  $< ${BBFUNCS} -o $@

+ 25
- 0
tools/read_obj.c View File

@@ -0,0 +1,25 @@
1
+/*
2
+     tentatives de lecture des OBJ
3
+*/
4
+
5
+#include	<stdio.h>
6
+#include	<stdlib.h>
7
+#include	"../bubulles.h"
8
+
9
+int main(int argc, char *argv[])
10
+{
11
+int		foo;
12
+
13
+if (2 != argc) {
14
+	bubulles_version(1);
15
+	exit(0);
16
+	}
17
+
18
+
19
+// foo = try_to_read_an_OBJ_file(argv[1], 0);
20
+
21
+
22
+
23
+
24
+return 0;
25
+}

Loading…
Cancel
Save