Browse Source

read .OBJ file, first try

master
tonton th 2 years ago
parent
commit
5a6e98d034
  1. 4
      .gitignore
  2. 5
      Makefile
  3. 2
      bubulles.h
  4. 0
      doc/tricks.txt
  5. 26
      importobj.c
  6. 5
      tools/Makefile
  7. 25
      tools/read_obj.c

4
.gitignore vendored

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

5
Makefile

@ -12,12 +12,15 @@ CC = gcc @@ -12,12 +12,15 @@ CC = gcc
OPT = -Wall -g -DDEBUG_LEVEL=0 -DMUST_ABORT
libbubulles.a: bubulles.o
libbubulles.a: bubulles.o importobj.o
ar r $@ $?
bubulles.o: bubulles.c bubulles.h Makefile
$(CC) $(OPT) -c $<
importobj.o: importobj.c bubulles.h Makefile
$(CC) $(OPT) -c $<
# ------------------------------------------------
# --- build some tests and tools

2
bubulles.h

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
/* --------------------------------------------------------------------- */
#define LIBBB_VERSION 52
#define LIBBB_VERSION 53
#define SZ_BUBULLE_TEXT 51 /* arbitrary value */

0
doc/tricks.txt

26
importobj.c

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
/*
LIBBUBULLES
some functions for importing bubulles from dot-OBJ files.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bubulles.h"
/* --------------------------------------------------------------------- */
int try_to_read_an_OBJ_file(char *fname, int notused)
{
FILE *fpin;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' %d)\n", fname, notused);
#endif
return -7800;
}
/* --------------------------------------------------------------------- */

5
tools/Makefile

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

25
tools/read_obj.c

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/*
tentatives de lecture des OBJ
*/
#include <stdio.h>
#include <stdlib.h>
#include "../bubulles.h"
int main(int argc, char *argv[])
{
int foo;
if (2 != argc) {
bubulles_version(1);
exit(0);
}
// foo = try_to_read_an_OBJ_file(argv[1], 0);
return 0;
}
Loading…
Cancel
Save