-I$(top_srcdir)/src/lib/eo \
-I$(top_srcdir)/src/lib/evas \
-I$(top_srcdir)/src/lib/ecore \
+-I$(top_srcdir)/src/lib/ecore_file \
-I$(top_srcdir)/src/lib/ecore_input \
-I$(top_srcdir)/src/lib/ecore_evas \
-I$(top_builddir)/src/lib/efl \
-I$(top_builddir)/src/lib/eo \
-I$(top_builddir)/src/lib/evas \
-I$(top_builddir)/src/lib/ecore \
+-I$(top_builddir)/src/lib/ecore_file \
-I$(top_srcdir)/src/lib/ecore_input \
-I$(top_builddir)/src/lib/ecore_evas \
-DPACKAGE_EXAMPLES_DIR=\".\" \
$(top_builddir)/src/lib/eina/libeina.la \
$(top_builddir)/src/lib/eo/libeo.la \
$(top_builddir)/src/lib/ecore/libecore.la \
+$(top_builddir)/src/lib/ecore_file/libecore_file.la \
$(top_builddir)/src/lib/ecore_input/libecore_input.la \
$(top_builddir)/src/lib/ecore_evas/libecore_evas.la \
$(top_builddir)/src/lib/evas/libevas.la \
* Compile with "gcc -o evas-3d-aabb evas-3d-aabb.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo`"
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define WIDTH 400
#define HEIGHT 400
+static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sonic.md2";
+static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/sonic.png";
+
Ecore_Evas *ecore_evas = NULL;
Evas *evas = NULL;
Eo *background = NULL;
material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
eo_do(mesh,
- efl_file_set(EVAS_3D_MODEL_FOLDER"sonic.md2", NULL),
+ efl_file_set(model_path, NULL),
evas_3d_mesh_frame_material_set(0, material),
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(texture,
- evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"sonic.png", NULL),
+ evas_3d_texture_file_set(image_path, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
EVAS_3D_TEXTURE_FILTER_NEAREST),
evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
*/
//TODO new resources
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define ANIMATION_COUNT 3
#define MAX_PATH 128
+static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/M15.obj";
+static const char *image1_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/M15.png";
+static const char *image2_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/M15_1.png";
+
Ecore_Evas *ecore_evas = NULL;
Evas *evas = NULL;
Evas_Object *image = NULL, *bg = NULL;
if (!row) row = 2;
if (!col) col = 5;
- if (!model) model = EVAS_3D_MODEL_FOLDER"M15.obj";
- if (!texture1) texture1 = EVAS_3D_IMAGE_FOLDER"M15.png";
- if (!texture2) texture2 = EVAS_3D_IMAGE_FOLDER"M15_1.png";
+ if (!model) model = (char *)model_path;
+ if (!texture1) texture1 = (char *)image1_path;
+ if (!texture2) texture2 = (char *)image2_path;
fprintf(stdout, "row - %d, col - %d, model - %s, texture1 - %s, texture2 - %s\n",
row, col, model, texture1, texture2);
-#define EVAS_3D_IMAGE_FOLDER "resources/images/"
-#define EVAS_3D_MODEL_FOLDER "resources/models/"
-#define EVAS_3D_SAVED_FILES "saved_files/"
+#define EVAS_3D_IMAGE_FOLDER "/resources/images"
+#define EVAS_3D_MODEL_FOLDER "/resources/models"
+#define EVAS_3D_SAVED_FILES "/saved_files"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define WIDTH 400
#define HEIGHT 400
+static const char *normal_map_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/normal_lego.png";
+
typedef struct _Scene_Data
{
Eo *scene;
evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA,
EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels1[0]));
eo_do(data->texture_normal,
- evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"normal_lego.png", NULL));
+ evas_3d_texture_file_set(normal_map_path, NULL));
eo_do(data->material0,
evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, data->texture0));
* Show it in right side.
*
* @verbatim
-* gcc -o evas-3d-eet evas-3d-eet.c `pkg-config --libs --cflags efl eina evas ecore ecore-evas eo`
+* gcc -o evas-3d-eet evas-3d-eet.c `pkg-config --libs --cflags efl eina evas ecore ecore-evas ecore-file eo`
* @endverbatim
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define WIDTH 1024
#define HEIGHT 1024
+static const char *input_model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sonic.md2";
+static const char *output_model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES "/saved_Sonic_EET.eet";
+
Ecore_Evas *ecore_evas = NULL;
Evas *evas = NULL;
Eo *background = NULL;
material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
eo_do(mesh,
- efl_file_set(EVAS_3D_MODEL_FOLDER"sonic.md2", NULL),
+ efl_file_set(input_model_path, NULL),
evas_3d_mesh_frame_material_set(0, material),
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
0.50, 0.00, 0.50, 0.30),
evas_3d_material_shininess_set(50.0));
- eo_do(mesh, efl_file_save(EVAS_3D_SAVED_FILES"saved_Sonic_EET.eet", NULL, NULL));
+ if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES))
+ fprintf(stderr, "Failed to create folder %s\n\n",
+ PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES);
+
+ eo_do(mesh, efl_file_save(output_model_path, NULL, NULL));
eo_do(mesh2,
- efl_file_set(EVAS_3D_SAVED_FILES"saved_Sonic_EET.eet", NULL),
+ efl_file_set(output_model_path, NULL),
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
mesh_node = eo_add(EVAS_3D_NODE_CLASS, evas,
* Compile with "gcc -o evas-3d-frustum evas-3d-frustum.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` -lm"
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define WIDTH 800
#define HEIGHT 600
+static const char *image_eagle_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/eagle.png";
+static const char *eagle_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/eagle.md2";
+
typedef struct _Scene_Data
{
Eo *root_node;
data->texture_model = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(data->texture_model,
- evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"eagle.png", NULL),
+ evas_3d_texture_file_set(image_eagle_path, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, EVAS_3D_TEXTURE_FILTER_NEAREST),
evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, EVAS_3D_WRAP_MODE_REPEAT));
evas_3d_material_shininess_set(100.0));
eo_do(data->mesh_model,
- efl_file_set(EVAS_3D_MODEL_FOLDER"eagle.md2", NULL),
+ efl_file_set(eagle_path, NULL),
evas_3d_mesh_frame_material_set(0, data->material_model),
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE));
}
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define WIDTH 400
#define HEIGHT 400
+static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sonic.md2";
+static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/sonic.png";
+
Ecore_Evas *ecore_evas = NULL;
Evas *evas = NULL;
Eo *background = NULL;
material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
eo_do(mesh,
- efl_file_set(EVAS_3D_MODEL_FOLDER"sonic.md2", NULL),
+ efl_file_set(model_path, NULL),
evas_3d_mesh_frame_material_set(0, material),
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(texture,
- evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"sonic.png", NULL),
+ evas_3d_texture_file_set(image_path, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
EVAS_3D_TEXTURE_FILTER_NEAREST),
evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
* @endverbatim
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define HEIGHT 1000
#define LOAD_AND_ADD_MESH(extention, number) \
- extention##_file = \
- eina_file_open(EVAS_3D_MODEL_FOLDER"mesh_for_mmap."#extention, 0); \
+ snprintf(buffer, PATH_MAX, "%s%s", template_path, #extention); \
+ extention##_file = eina_file_open(buffer , 0); \
mesh_##extention = eo_add(EVAS_3D_MESH_CLASS, evas); \
eo_do(mesh_##extention, \
evas_3d_mesh_mmap_set(extention##_file, NULL), \
initial_node_data[number * 10 + 9]));\
ecore_timer_add(0.01, _animate_##extention, node_##extention);
+static const char *template_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/mesh_for_mmap.";
+
Ecore_Evas *ecore_evas = NULL;
Evas *evas = NULL;
Eo *background = NULL;
int
main(void)
{
+ char buffer[PATH_MAX];
Eina_File *obj_file, *ply_file, *eet_file, *md2_file;
//Unless Evas 3D supports Software renderer, we set gl backened forcely.
* gcc -o evas-3d-moon-space evas-3d-moon-space.c -g `pkg-config --libs --cflags evas ecore ecore-evas eo` -lm
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define WIDTH 1024
#define HEIGHT 1024
+static const char *bg_image = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/bg_space.jpg";
+static const char *moon_image = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/moon.png";
+static const char *earth_image = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/EarthDiffuse.png";
+
typedef struct _Scene_Data
{
Eo *texture_diffuse_moon;
/* Setup material and texture for planet. */
eo_do(data->texture_diffuse_planet,
- evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"EarthDiffuse.png", NULL),
+ evas_3d_texture_file_set(earth_image, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR));
eo_do(data->material_planet,
/* Setup material and texture for moon. */
eo_do(data->texture_diffuse_moon,
- evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"moon.png", NULL),
+ evas_3d_texture_file_set(moon_image, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR));
eo_do(data->material_moon,
/* Add evas objects. */
background = evas_object_image_filled_add(evas);
- evas_object_image_file_set(background, EVAS_3D_IMAGE_FOLDER"bg_space.jpg", NULL),
+ evas_object_image_file_set(background, bg_image, NULL),
evas_object_resize(background, WIDTH, HEIGHT),
evas_object_show(background);
* If material was not set it will be not saved.
*
* @verbatim
-* gcc -o evas-3d-obj evas-3d-obj.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo`
+* gcc -o evas-3d-obj evas-3d-obj.c `pkg-config --libs --cflags efl evas ecore ecore-evas ecore-file eo`
* @endverbatim
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define GRID_SIZE 6
#define NUMBER_OF_MESHES 8
-#define ADD_OBJ_MESH(path, Y, Z, num, shade_mode, name_of_material) \
- mesh[num] = eo_add(EVAS_3D_MESH_CLASS, evas); \
- eo_do(mesh[num], \
- efl_file_set(path".obj", NULL), \
- evas_3d_mesh_frame_material_set(0, name_of_material), \
- evas_3d_mesh_shade_mode_set(shade_mode)); \
- mesh_node[num] = eo_add(EVAS_3D_NODE_CLASS, evas, \
- evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH)); \
- eo_do(root_node, \
- evas_3d_node_member_add(mesh_node[num])); \
- eo_do(mesh_node[num], \
- evas_3d_node_mesh_add(mesh[num]), \
- evas_3d_node_position_set(0, Y, Z)); \
-
-#define ADD_OBJ_MESH_AND_SAVED_COPY(path, Y, Z, num, shade_mode, name_of_material) \
- ADD_OBJ_MESH(EVAS_3D_MODEL_FOLDER"sweet_"#path, \
- Y, Z, num, shade_mode, name_of_material) \
- eo_do(mesh[num], efl_file_save(EVAS_3D_SAVED_FILES"saved_"#path".obj", \
- NULL, NULL)); \
- ADD_OBJ_MESH(EVAS_3D_SAVED_FILES"saved_"#path, \
- Y + COPY_OFFSET, Z, num + 4, shade_mode, name_of_material)
+#define ADD_OBJ_MESH(path, Y, Z, num, shade_mode, name_of_material) \
+ mesh[num] = eo_add(EVAS_3D_MESH_CLASS, evas); \
+ snprintf(full_file_path, PATH_MAX, "%s%s", path, ".obj"); \
+ eo_do(mesh[num], \
+ efl_file_set(full_file_path, NULL), \
+ evas_3d_mesh_frame_material_set(0, name_of_material), \
+ evas_3d_mesh_shade_mode_set(shade_mode)); \
+ mesh_node[num] = eo_add(EVAS_3D_NODE_CLASS, evas, \
+ evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH)); \
+ eo_do(root_node, \
+ evas_3d_node_member_add(mesh_node[num])); \
+ eo_do(mesh_node[num], \
+ evas_3d_node_mesh_add(mesh[num]), \
+ evas_3d_node_position_set(0, Y, Z)); \
+
+#define ADD_OBJ_MESH_AND_SAVED_COPY(path, Y, Z, num, shade_mode, name_of_material)\
+ snprintf(buffer, PATH_MAX, "%s%s", input_template, #path); \
+ ADD_OBJ_MESH(buffer, Y, Z, num, shade_mode, name_of_material) \
+ snprintf(buffer, PATH_MAX, "%s%s%s", output_template, #path, ".obj"); \
+ eo_do(mesh[num], efl_file_save(buffer, NULL, NULL)); \
+ snprintf(buffer, PATH_MAX, "%s%s", output_template, #path); \
+ ADD_OBJ_MESH(buffer, Y + COPY_OFFSET, Z, num + 4, shade_mode, name_of_material)
#define ADD_TEXTURE(name, path) \
name = eo_add(EVAS_3D_TEXTURE_CLASS, evas); \
COL_BLUE, 0.5), \
evas_3d_material_shininess_set(100.0));
+static const char *texture_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/sweet_home_reversed.png";
+static const char *output_template = PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES "/saved_";
+static const char *input_template = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sweet_";
+
Ecore_Evas *ecore_evas = NULL;
Evas *evas = NULL;
Eo *background = NULL;
main(void)
{
int i;
+ char buffer[PATH_MAX], full_file_path[PATH_MAX];
//Unless Evas 3D supports Software renderer, we set gl backened forcely.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1);
eo_do(root_node,
evas_3d_node_member_add(light_node));
- ADD_TEXTURE(texture, EVAS_3D_IMAGE_FOLDER"sweet_home_reversed.png")
+ ADD_TEXTURE(texture, texture_path)
ADD_MATERIAL(material)
eo_do(material_with_tex,
evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, texture));
+ if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES))
+ fprintf(stderr, "Failed to create folder %s\n\n",
+ PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES);
+
ADD_OBJ_MESH_AND_SAVED_COPY(home, -GRID_SIZE, -GRID_SIZE, 0,
EVAS_3D_SHADE_MODE_PHONG, material_with_tex)
ADD_OBJ_MESH_AND_SAVED_COPY(home_without_normals, -GRID_SIZE, GRID_SIZE, 1,
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define WIDTH 400
#define HEIGHT 400
+static const char *earth_image = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/EarthDiffuse.png";
+
typedef struct _vec4
{
float x;
texture_diffuse = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(texture_diffuse,
- evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"EarthDiffuse.png", NULL),
+ evas_3d_texture_file_set(earth_image, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR,
EVAS_3D_TEXTURE_FILTER_LINEAR));
eo_do(material,
* and geometry to "saved_man_all_with_mods.ply", "saved_man_only_geometry.ply" and "saved_man_without_UVs.ply".
*
* @verbatim
-* gcc -o evas-3d-ply evas-3d-ply.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo`
+* gcc -o evas-3d-ply evas-3d-ply.c `pkg-config --libs --cflags efl evas ecore ecore-evas ecore-file eo`
* @endverbatim
*/
//TODO new resources
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define NUMBER_OF_MESHES 32
+static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/normal_lego.png";
+static const char *input_template = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/";
+static const char *output_template = PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES "/";
+static const char *file_name[8] = {"Normal_UVs_Colors.ply",
+ "Normal_UVs_NoColors.ply",
+ "Normal_NoUVs_Colors.ply",
+ "Normal_NoUVs_NoColors.ply",
+ "NoNormal_UVs_Colors.ply",
+ "NoNormal_UVs_NoColors.ply",
+ "NoNormal_NoUVs_Colors.ply",
+ "NoNormal_NoUVs_NoColors.ply"};
+
int draw_mode[2] = {EVAS_3D_SHADE_MODE_PHONG, EVAS_3D_SHADE_MODE_VERTEX_COLOR};
Ecore_Evas *ecore_evas = NULL;
Eo *light = NULL;
Ecore_Animator *anim = NULL;
-char *file_name[8] = {"Normal_UVs_Colors.ply",
- "Normal_UVs_NoColors.ply",
- "Normal_NoUVs_Colors.ply",
- "Normal_NoUVs_NoColors.ply",
- "NoNormal_UVs_Colors.ply",
- "NoNormal_UVs_NoColors.ply",
- "NoNormal_NoUVs_Colors.ply",
- "NoNormal_NoUVs_NoColors.ply"};
-
static float angle = 0;
static Eina_Bool
material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(texture,
- evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"normal_lego.png", NULL),
+ evas_3d_texture_file_set(image_path, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
EVAS_3D_TEXTURE_FILTER_NEAREST),
evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
1.0, 1.0, 1.0, 1.0),
evas_3d_material_shininess_set(50.0));
+ if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES))
+ fprintf(stderr, "Failed to create folder %s\n\n",
+ PACKAGE_EXAMPLES_DIR EVAS_3D_SAVED_FILES);
+
/* Add the meshes. */
for (i = 0; i < NUMBER_OF_MESHES; i++)
{
mesh[i] = eo_add(EVAS_3D_MESH_CLASS, evas);
- snprintf(buffer, PATH_MAX, "%s%s", EVAS_3D_MODEL_FOLDER, file_name[i % 8]);
+ snprintf(buffer, PATH_MAX, "%s%s", input_template, file_name[i % 8]);
eo_do(mesh[i],
efl_file_set(buffer, NULL),
evas_3d_mesh_frame_material_set(0, material),
evas_3d_mesh_shade_mode_set(draw_mode[(i % 16) / 8]));
- snprintf(buffer, PATH_MAX, "%s%s", EVAS_3D_SAVED_FILES, file_name[i % 8]);
+ snprintf(buffer, PATH_MAX, "%s%s", output_template, file_name[i % 8]);
eo_do(mesh[i], efl_file_save(buffer, NULL, NULL));
if (i > 15)
* Compile with gcc -o evas-3d-shadows evas-3d-shadows.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo eina` -lm
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
#define EFL_EO_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#define DIFFUSE_LIGHT 1.0, 1.0, 1.0
#define SPECULAR_LIGHT 1.0, 1.0, 1.0
+static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_3D_MODEL_FOLDER "/sonic.md2";
+static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_3D_IMAGE_FOLDER "/sonic.png";
+
Ecore_Evas *ecore_evas = NULL;
Evas *evas = NULL;
Eo *background = NULL;
{
Eo *texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(texture,
- evas_3d_texture_file_set(EVAS_3D_IMAGE_FOLDER"sonic.png", NULL),
+ evas_3d_texture_file_set(image_path, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
EVAS_3D_TEXTURE_FILTER_NEAREST),
evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
model->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
eo_do(model->mesh,
- efl_file_set(EVAS_3D_MODEL_FOLDER"sonic.md2", NULL),
+ efl_file_set(model_path, NULL),
evas_3d_mesh_frame_material_set(0, model->material),
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));