vertex_format_get_info 함수 설명

vertex_format_get_info 함수는 이전에 생성된 정점 형식에 대한 정보를 담고 있는 구조체를 반환합니다. 이 함수는 그래픽스 프로그래밍에서 정점 데이터를 처리할 때 유용하게 사용됩니다.

정점 형식 정보 구조체

변수명 타입 설명
stride Real 단일 정점의 총 크기(바이트)
num_elements Real 단일 정점 내의 요소(정점 속성) 수
elements Array 요소의 배열. 각 배열 요소는 다음을 포함하는 구조체입니다:
- usage (정점 사용 유형 상수)
- type (정점 데이터 유형 상수)
- size (Real)
- offset (Real)

구문

vertex_format_get_info(format);

인수

인수명 타입 설명
format Vertex Format vertex_format_end에 의해 반환된 정점 형식

반환값

  • Vertex Format Info Struct

예제

아래 코드는 사용자 정의 정점 형식을 생성한 후, vertex_format_get_info를 사용하여 정보를 가져오는 예제입니다.

vertex_format_begin();
vertex_format_add_position_3d();
vertex_format_add_normal();
vertex_format_add_colour();
vertex_format_add_texcoord();
vertex_format_add_custom(vertex_type_float1, vertex_usage_texcoord);
vertex_format = vertex_format_end();

var _info = vertex_format_get_info(vertex_format);
show_debug_message(json_stringify(_info, true));

위의 코드는 먼저 사용자 정의 정점 형식을 생성한 다음, vertex_format_get_info를 사용하여 정보를 가져오고, 그 정보를 디버그 메시지로 표시합니다.

활용 예제

  1. 정점 형식 생성 및 정보 출력 gml vertex_format_begin(); vertex_format_add_position_3d(); vertex_format_add_normal(); vertex_format = vertex_format_end(); var info = vertex_format_get_info(vertex_format); show_debug_message(json_stringify(info, true));
  2. 커스텀 정점 속성 추가 gml vertex_format_begin(); vertex_format_add_position_3d(); vertex_format_add_custom(vertex_type_float2, vertex_usage_texcoord); vertex_format = vertex_format_end(); var info = vertex_format_get_info(vertex_format); show_debug_message(json_stringify(info, true));
  3. 정점 형식의 요소 수 확인 gml vertex_format_begin(); vertex_format_add_position_3d(); vertex_format_add_colour(); vertex_format = vertex_format_end(); var info = vertex_format_get_info(vertex_format); var num_elements = info.num_elements; show_debug_message("Number of elements: " + string(num_elements));
  4. 정점 형식의 stride 값 확인 gml vertex_format_begin(); vertex_format_add_position_3d(); vertex_format_add_normal(); vertex_format = vertex_format_end(); var info = vertex_format_get_info(vertex_format); var stride = info.stride; show_debug_message("Stride value: " + string(stride));

이러한 예제들은 vertex_format_get_info 함수를 활용하여 정점 형식에 대한 다양한 정보를 얻고 활용하는 방법을 보여줍니다.

Read more

기술 문서 해설 및 활용 예제

이 문서는 특정 기술에 대한 설명과 활용 방법을 다룹니다. 아래에서 내용을 쉽게 이해할 수 있도록 해설하고, 다양한 활용 및 응용 예제를 추가로 제공합니다. 기술 개요 이 기술은 게임 개발에서 자주 사용되는 기능으로, 특정 작업을 자동화하거나 효율적으로 처리하는 데 도움을 줍니다. 주로 게임의 로직을 구성하거나 사용자 인터페이스를 제어하는 데 사용됩니다. 주요

By 이재협/실장/시스템개발실/PHYSIA

키워드 설명서

이 문서는 특정 키워드에 대한 설명과 사용법을 제공합니다. 문법 (arguments); 인수 인수 이름 유형 설명 argument_name 인수에 대한 설명을 여기에 작성합니다. 반환값 (선택적 설명) 예제 code_example() { // 여기에 코드 예제를 설명합니다. } 코드 예제 설명 위의 코드 예제는 특정 기능을 수행하는 함수의 기본 구조를 보여줍니다. 이 함수는 인수를 받아들이고, 특정

By 이재협/실장/시스템개발실/PHYSIA

GameMaker 환경 설정 및 기능

이 문서에서는 GameMaker의 환경 설정 및 다양한 IDE 기능에 대한 정보를 제공합니다. 다음은 주요 항목들입니다: IDE 환경 설정 IDE(통합 개발 환경) 설정은 GameMaker의 전반적인 사용 경험을 조정하는 데 도움을 줍니다. 여기서 사용자는 개인의 필요에 맞게 다양한 옵션을 설정할 수 있습니다. 주요 설정 항목 설정 항목 설명 테마 IDE의 색상

By 이재협/실장/시스템개발실/PHYSIA

GameMaker IDE 설명서

GameMaker IDE는 게임을 만들고 소프트웨어에서 제공하는 모든 기능을 활용하는 주요 인터페이스입니다. 이 프로그램은 시작 화면부터 게임을 만들기 위해 사용하는 모든 편집기 창까지 포함되며, 매뉴얼과 다양한 튜토리얼에서 IDE라고 언급됩니다. IDE의 구성 요소 다음 섹션에서는 IDE에 대한 정보를 다룹니다: 1. 설정 및 기능 IDE의 설정 및 기능은 사용자가 게임 개발을 보다 효율적으로

By 이재협/실장/시스템개발실/PHYSIA