Skip to content

Commit a06b46c

Browse files
committed
Merge branch 'latest' of github.com:vuelto-org/vuelto into latest
2 parents 7097008 + f771600 commit a06b46c

File tree

6 files changed

+178
-9
lines changed

6 files changed

+178
-9
lines changed

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Vuelto Changelog
2+
3+
## Vuelto 1.1 (05/01/2025)
4+
5+
### Breaking changes
6+
7+
- Updated to OpenGL 3.3 Core, breaking compatibility with unsupported hardware.
8+
- `DrawLine()` now takes arguments in the order `x1 y1 x2 y2`, instead of `x1 x2 y1 y2`.
9+
- `Image` struct now uses a `Pos` parameter with `Vector2D` type instead of `X,Y` `float32` param for position.
10+
- `Line` struct now uses `Pos1` and `Pos2` params with `Vector2D` type instead of `X1, Y1, X2, Y2`.
11+
- `Rect` struct now uses `Pos` param with `Vector2D` type instead of `X, Y`.
12+
13+
### Additions
14+
15+
- Support for targeting web (WASM + WebGL 2.0).
16+
- Event system
17+
- KeyPressed, KeyPressedOnce, and KeyReleased
18+
- Mouse position
19+
- `GetDeltaTime()`
20+
- Framerate managing
21+
- `GetFPS()`
22+
- `SetFPS()`
23+
24+
### Changes
25+
26+
- The above mentioned breaking changes.
27+
- Params `X` and `Y` (and `Z`) for `Vector2D` and `Vector3D` are now of type `float32` instead of `float64`.
28+
- Improved performance.
29+
30+
<!-- TODO: review older versions and log their changes -->

pkg/renderer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
package vuelto
1414

1515
type Renderer2D struct {
16-
Window *Window
17-
LegacyGL bool
16+
Window *Window
1817
}
1918

2019
// Creates a new renderer thats connected to the window.

website/blog/.authors.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ authors:
33
name: Zaka
44
description: Vuelto Team
55
avatar: https://0.gravatar.com/avatar/97d096fa42833c482e4e2f5636421ac224790ff071e431e59448f01e27dce5d2?size=512
6-
# todo: add Dima
6+
# dimkauzh: uncomment when we got an avatar for bro (no avatar = failed build)
7+
# name: Dima
8+
# description: Vuelto Founder
9+
# avatar: todo ig
1.37 MB
Loading

website/blog/posts/vuelto-1-1.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
draft: false
3+
date: 2025-01-05
4+
categories:
5+
- Updates
6+
- Releases
7+
authors:
8+
- zaka
9+
slug: vuelto-1-1-release
10+
pin: true
11+
readtime: 5 # more or less
12+
---
13+
14+
# Vuelto 1.1 released\! Here's what's new
15+
16+
![Post cover](../assets/vuelto-1-1-cover.png)
17+
18+
Hi there! Happy new year to everyone. We’re *a bit* late, but still hyped to give you everyone this year’s gift: **Vuelto 1.1!** While it’s a *minor* update from a user perspective, it’s a whole revamp of Vuelto’s internals, bringing - among other things - support for making web-based games from the same codebase! We also improved performance, made the groundwork for the now available events system, and even more. So let's dive into it!
19+
20+
<!-- more -->
21+
## The new Vuelto renderer
22+
23+
Vuelto 1.0’s legacy renderer uses a pipelined system for rendering graphics. It looks kinda like this:
24+
25+
```go
26+
// ...
27+
gl.Vertex2f(x, y)
28+
gl.Vertex2f(x+width, y)
29+
gl.Vertex2f(x+width, y+height)
30+
gl.Vertex2f(x, y+height)
31+
// ...
32+
```
33+
34+
Vuelto 1.1 refactored the rendering system, using OpenGL 3.3 Core and taking a shader based approach like this:
35+
36+
```go
37+
vertexShader := NewShader(VERTEX_SHADER, "vertex_shader_web.glsl", "vertex_shader_desktop.glsl")
38+
fragmentShader := NewShader(FRAGMENT_SHADER, "fragment_shader_web.glsl", "fragment_shader_desktop.glsl")
39+
40+
vertexShader.Compile()
41+
fragmentShader.Compile()
42+
43+
program := NewProgram(*vertexShader, *fragmentShader)
44+
program.Link()
45+
program.Use()
46+
```
47+
48+
This brings in performance improvements and sets the groundwork for supporting advanced features like material textures in future versions.
49+
50+
!!! note
51+
Keep in mind GL 3.3 is not compatible with super old hardware. The legacy renderer has been removed, so you’ll have to stick with it.
52+
53+
## Web support
54+
55+
Now Vuelto is capable of compiling your games to both the desktop with GLFW and the web with WebAssembly and WebGL from the same codebase! That’s made possible thanks to a bunch of refactors to the widowing system that, besides improving code maintainability, made this possible. All features supported by Vuelto will work seamlessly on the web, we’ll take care of code splitting and conversion everywhere possible.
56+
57+
There are two exceptions for this, as of now:
58+
59+
- Images won’t work on the web by default. If you’re targeting web & desktop at the same time, a small different approach is needed.
60+
- Games that launch more than one window won’t work on the web at all.
61+
62+
In the end, as long as you don’t open two windows on the web and use `ImageEmbed` instead of an image path (more onto that later), your Vuelto games are now fully cross-platform: Linux, Windows, macOS, and the web.
63+
64+
## Enhanced windowing and rendering
65+
66+
We just told you that we refactored the windowing system. This doesn’t only bring the almighty web support, but also adds **framerate management**. You can now get the framerate of your game with `window.GetFPS()`, or even better, you can **set your window’s framerate** with `window.SetFPS()`.
67+
68+
And besides that, a function most game devs can’t get off their head and somehow wasn’t in Vuelto - until now. **`window.GetDeltaTime()`**! Finally, we brought this good boy in.
69+
70+
Another change, regarding the previously mentioned image support for the web, is that now images support embedding.
71+
72+
The classic way to render an image in Vuelto is to go this:
73+
74+
```go
75+
image := renderer.LoadImage("path/to/image.png", 10, 10, 50, 50) // returns an Image (internal type)
76+
```
77+
78+
This works fine, but only on the desktop. For an image that works both on the desktop and the web, you’ll need an ImageEmbed instead of a file path.
79+
80+
An ImageEmbed struct takes two parameters, Filesystem, which should always be embed.FS, and then the filename of the image to use.
81+
82+
```go
83+
var embeddedFiles embed.FS
84+
85+
imageEmbed := vuelto.ImageEmbed{
86+
Filesystem: embeddedFiles,
87+
Image: "image.png",
88+
}
89+
90+
image := renderer.LoadImage(imageEmbed, 0, 0, 1, 1)
91+
```
92+
93+
Once loaded like this, you can just do image.Draw(), and you now got a web-proof image on screen.
94+
95+
## Events system
96+
97+
As promised in our birthday blog post, we’re bringing events to Vuelto. They are still basic, but the groundwork made so far is sufficient for making v1.1 a great release, and also sets a base we’ll build on top of in the following releases. For now you can get **key press** and **key release** events reactively, and the **mouse position** imperatively.
98+
99+
Key press & release events are used like this:
100+
101+
```go
102+
if KeyPressed(“E”) == true {
103+
fmt.Println(“you pressed it”)
104+
}
105+
// ...
106+
if KeyReleased(“E”) {
107+
fmt.Println(“you’re not pressing it”)
108+
}
109+
```
110+
111+
We said you can get these “reactively” because the boolean return of both functions immediately switches as soon as the user toggles the event. `”you pressed it”` will be immediately printed each time I press `E`, as each time the event is fired, the state of the function changes, firing the code inside the `if` block. The same happens with release events, each time I release the `E` key, `”you’re not pressing it”` would print.
112+
113+
Keep in mind code inside `if KeyPressed(“E”)` will fire multiple times - one per frame, actually. `KeyPressed(“E”)` will stay true until I release the key, and the window’s life-cycle itself is a loop, so events get fired repeatedly.
114+
115+
If you need to fire code only once, you can use `KeyPressedOnce(“E”)`.
116+
117+
Besides these, we also have `MousePos()` (not *Get*MousePos())
118+
119+
```go
120+
position := window.MousePos() // imagine X is 20 and Y is 30
121+
```
122+
123+
From here, we can access `position.X`, which will return 20, `position.Y`, which will return 30, and `position.Pos()` to get both together as `20, 30`.
124+
125+
Keep in mind the `position` variable won’t change as the window refreshes. That’s why we said *you can get it “imperatively”*. `MousePos()` returns the value for the moment of the call and doesn’t update it, so you’ll have to call `MousePos()` exactly where you want to use it (or just use some sort of loop).
126+
127+
## Better documentation
128+
129+
Vuelto 1.0 was, to be honest, almost documentation less. We’ve fixed that! Here, at vuelto.pp.ua, Vuelto 1.1 is now fully documented and includes code examples, easy to follow explanations on core concepts such as the game loop, and more. All of that with that nicely refreshed branding we told you about on our last (and first too!) blog post. It’s something to be proud of, isn’t it?
130+
131+
And that’s all, my fellows! We hope you’re as excited to try out Vuelto 1.1 as we are to release it right now. See the full release notes at our [CHANGELOG.md file](https://github.com/vuelto-org/vuelto/blob/main/CHANGELOG.md), and have fun with it!
132+
133+
Best wishes for this newly started year from the Vuelto team.
134+
135+
Onward and upward,
136+
137+
> Zaka, from the Vuelto Team.

website/blog/posts/were-one-year-old.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ categories:
66
authors:
77
- zaka
88
slug: were-one-year-old
9-
pin: true
9+
pin: false
1010
readtime: 3 # more or less
1111
---
1212

13-
![Post cover](../assets/were-one-year-old-cover.png)
13+
# We’re one year old\! V1.1 is coming, and it’s looking good
1414

15-
# We’re one year old\! V1.1 is coming, and it’s looking good\!
15+
![Post cover](../assets/were-one-year-old-cover.png)
1616

1717
Hi there\! I’m [Zaka](https://github.com/ZakaHaceCosas), and I’m a new addition to the Vuelto Team, though I’ve known this engine for a while. Feels like it’s already been a year since I got to know this engine \- and indeed, it has been a year since it was made\! Today, one year ago, Vuelto was created as an alternative to [Fusion Engine](https://github.com/fusionengine-org/fusion), another engine made by the same creator.
1818

1919
We at Vuelto have been cooking a new release for a while now, and while it’s not ready for today as we still work on it, it’s coming soon (in fact, there’s already a [PR draft](https://github.com/vuelto-org/vuelto/pull/8)), and it’s looking pretty neat.
2020

21+
<!-- more -->
2122
## New rendering system approach
2223

2324
Currently, Vuelto 1.0 uses a pipelined system for rendering graphics. It looks kinda like this:
@@ -70,7 +71,7 @@ window.Resizable = resizable
7071

7172
\- you now have something that works with both the web and GLFW. Under the hood, Vuelto will take care of code filtering for each platform, so you don’t gotta worry about that.
7273

73-
## Events\!
74+
## Events\
7475

7576
*There’s less progress on this area* BUT \- it’s a thing, and it’s coming in V1.1\! While this is still in early stages and subject to changes, for now the idea is to make them using a boolean (`true`/`false`) structure.
7677

@@ -94,7 +95,6 @@ vuelto.GetMousePox().Y // 131
9495

9596
!!! note
9697
Keep in mind that the function returns the value for the moment of the call.
97-
9898
The value is not “reactive” like a web dev would say, so if you want to constantly keep track of the value, you’ll have to use some sort of loop.
9999

100100
## Better engine, better looks
@@ -109,5 +109,5 @@ And that’s all, my fellows\! Again, this is still in the works, V1.1 will have
109109

110110
For now, happy birthday, Vuelto\!
111111

112-
God bless you,
112+
Onward and upward,
113113
> \- [Zaka](https://github.com/ZakaHaceCosas), from the Vuelto Team.

0 commit comments

Comments
 (0)