Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Apr 5, 2024
1 parent 08c02a9 commit a0ca98a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/pendulum-simulation/modules/sim/sim.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module sim

pub struct SimState {
mut:
pub mut:
position Vector3D
velocity Vector3D
accel Vector3D
Expand Down
1 change: 1 addition & 0 deletions examples/pendulum-simulation/modules/sim/vec.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import math

// Vector3D is a 3D vector
pub struct Vector3D {
pub:
x f64
y f64
z f64
Expand Down
4 changes: 2 additions & 2 deletions examples/pendulum-simulation/modules/sim/worker.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ const max_iterations = 1000
const simulation_delta_t = 0.0005

pub struct SimRequest {
pub:
params SimParams
state SimState
pub:
id int
id int
}

pub struct SimResult {
Expand Down
2 changes: 1 addition & 1 deletion examples/sokol/particles/modules/particle/particle.v
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn remap(v f64, min f64, max f64, new_min f64, new_max f64) f64 {

// Particle
pub struct Particle {
mut:
pub mut:
location vec.Vec2[f64]
velocity vec.Vec2[f64]
acceleration vec.Vec2[f64]
Expand Down
2 changes: 2 additions & 0 deletions examples/sokol/particles/modules/particle/system.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import rand
import sokol.sgl

pub struct SystemConfig {
pub:
pool int
}

pub struct System {
pub:
width int
height int
mut:
Expand Down
8 changes: 3 additions & 5 deletions examples/vweb/vweb_websocket/vweb_websocket.v
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ fn new_app() !&App {
}

fn new_websocker_server() !&websocket.Server {
mut wss := &websocket.Server{
logger: &log.Log{
level: .debug
}
}
mut logger := &log.Log{}
logger.set_level(.debug)
mut wss := websocket.new_server(.ip, 0, '', logger: logger)
wss.on_connect(fn (mut server_client websocket.ServerClient) !bool {
slog('ws.on_connect, server_client.client_key: ${server_client.client_key}')
return true
Expand Down
1 change: 1 addition & 0 deletions vlib/vweb/sse/sse.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub mut:
}

pub struct SSEMessage {
pub:
id string
event string
data string
Expand Down

0 comments on commit a0ca98a

Please sign in to comment.