Programming/Programming

[GAME300] Graphic Programming 1~2

와들S 2023. 9. 15. 02:10

1. Lecture2: Intro to OpenGL

- GPU: Graphics Processing Unit. Typically found on a graphics card (dedicated)

- OpenGL: A Graphics Library- library with API (Application programming interface)
  Exposed functions which allows programmers to render 3D worlds as 2D images on the screen.
  3.3 was a major revision which changed the way many things operate inside the library.

- OpenGL works on both the CPU and the GPU. Parts of the API are processed through the CPU and then it also interfaces and passes off data to the GPU.

- GPU's contain a bunch of tiny processors called "Shader processors." GPU manages communication of processing from all these shader processors. 

- Data Pipeline: Data flows in a lateral movement / flow from one pipe or processor to another.
   - Components of the pipeline include:
      - Processors:
           - Functions: api functions which modify or set the states for the openGL framework.
           - Shaders: compiled programs which run on the GPU's shader processors.
      - Data storage:
           - Textures: Images applied in 3d space
           - Frame buffers: Image still of data to be manipulated and applied to the screen.

- OpenGL program runs on the CPU. It has active states by default. 
  it manages communicating data through the rendering pipeline. 
  it compiles shader code at runtime. 
  it loads and applied shaders and executes draw calls.

 

2. Lecture3: Basic OpenGL Program Code Analysis

- OpenGL is an additional API (Application Program Interface) to SDL. 

- There are 3 separate possible parts to an API library. 
  - .dll: A dynamic link library : needs to be included side the .exe to work
  - .lib: A static linked library file: Gets included inside the .exe when linking
  - .h: a header: used to reference functions of a library.

- To add OpenGL to our project we need to place glew.h into our lib folder where libraries are contained. 
 Glew32 and glew32.lib need to be placed in the main project folder.

- A .dll and .lib are part of dynamic link library files. 
  Essentially this is a prebuilt set of code that you have access to (the API)

- When adding in a library to your project, you must link them.
  Settings -> Linker -> Input -> Additional Deipendencies

  glew32.lib;
  opengl32.lib;

 

'Programming > Programming' 카테고리의 다른 글

[GAME311] Lab1 Review  (1) 2023.10.17
[GAME300] Graphic Programming  (0) 2023.09.19
[GAME311] Singleton Pattern C++  (0) 2023.09.19
[C++] 구조체에서의 static 멤버  (0) 2023.09.09