void piglit_init(int argc, char **argv) { int prog; int tex_location; int i; enum shader_target test_stage = UNKNOWN; bool sampler_found = false; for (i = 1; i < argc; i++) { if (test_stage == UNKNOWN) { /* Maybe it's the shader stage? */ if (strcmp(argv[i], "vs") == 0) { test_stage = VS; continue; } else if (strcmp(argv[i], "fs") == 0) { test_stage = FS; continue; } } if (strcmp(argv[i], "140") == 0) { shader_version = 140; continue; } /* Maybe it's the sampler type? */ if (!sampler_found && (sampler_found = select_sampler(argv[i]))) continue; fail_and_show_usage(); } if (test_stage == UNKNOWN || !sampler_found) fail_and_show_usage(); /* Not implemented yet */ assert(sampler.target != GL_TEXTURE_CUBE_MAP_ARRAY); require_GL_features(test_stage); prog = generate_GLSL(test_stage); if (!prog) piglit_report_result(PIGLIT_FAIL); tex_location = piglit_GetUniformLocation(prog, "tex"); lod_location = piglit_GetUniformLocation(prog, "lod"); vertex_location = piglit_GetAttribLocation(prog, "vertex"); piglit_UseProgram(prog); piglit_Uniform1i(tex_location, 0); /* Create textures and set miplevel info */ set_base_size(); compute_miplevel_info(); generate_texture(); }
/** * @brief Constructor. * @param map The map containing the entity. * @param index Index of the entity in the map. */ Separator::Separator(MapModel& map, const EntityIndex& index) : EntityModel(map, index, EntityType::SEPARATOR) { // Separators can be extended either horizontally or vertically, but not both. set_resize_mode(ResizeMode::SINGLE_DIMENSION); set_base_size(QSize(16, 16)); // One of the width or height must remain equal to 16. DrawShapeInfo info; info.enabled = true; info.between_border_color = QColor(142, 142, 142); info.pixmap = QPixmap(":/images/entity_separator_resizable.png"); info.tiled_pixmap = true; set_draw_shape_info(info); }
/** * @brief Constructor. * @param map The map containing the entity. * @param index Index of the entity in the map. */ CustomEntity::CustomEntity(MapModel& map, const EntityIndex& index) : EntityModel(map, index, EntityType::CUSTOM) { set_origin(QPoint(8, 13)); set_base_size(QSize(8, 8)); set_resizable(true); set_num_directions(4); DrawShapeInfo info; info.enabled = true; info.background_color = QColor(224, 108, 72); info.between_border_color = QColor(184, 96, 96); info.pixmap = QPixmap(":/images/entity_custom_resizable.png"); set_draw_shape_info(info); }