Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n1ghtthef0x/kitsunecraft
My dirty way of making a Minecraft clone
https://github.com/n1ghtthef0x/kitsunecraft
clone cmake cpp glbinding glm minecraft opengl sdl
Last synced: about 2 months ago
JSON representation
My dirty way of making a Minecraft clone
- Host: GitHub
- URL: https://github.com/n1ghtthef0x/kitsunecraft
- Owner: N1ghtTheF0x
- Created: 2023-11-16T21:04:23.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-26T21:37:55.000Z (about 1 year ago)
- Last Synced: 2024-04-17T23:13:33.916Z (10 months ago)
- Topics: clone, cmake, cpp, glbinding, glm, minecraft, opengl, sdl
- Language: C
- Homepage:
- Size: 85 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# KitsuneCraft
My dirty way of making a Minecraft clone
## I now understand OpenGL
Somehow I learned how to OpenGL:
### Init
1. after making window, create opengl context
2. initialize opengl with any loader
3. compile both shaders
4. link shaders to program
5. get uniform location
6. delete shaders
7. generate vbo, vao
### When updating uniform
1. use program
2. set uniform
### For drawing something:
1. bind vao
2. bind ARRAY_BUFFER to vbo
3. buffer vertices data into ARRAY_BUFFER
3. set vertex attr pointer of
3. enable vertex attr array
4. use program
5. bind vao
6. draw now
### Loading image as texture
1. gen texture
2. bind texture to GL_TEXTURE_2D
3. glTexParameteri anything you want
4. load image
5. glTexImage2D that data there
- generate mip map if you want
6. if you can unload image, do it here
### Draw Loop
1. clear color | depth
2. active texture GL_TEXTURE and bind GL_TEXTURE_2D to image
3. use program
4. set view/projection
5. bind vao
6. for each object:
1. translate/rotate/scale (set model)
2. draw now
7. swap buffers