gg: remove obsolete usages of `use_ortho: true`
parent
cc91d9bee3
commit
f18265e6a8
|
@ -109,7 +109,6 @@ fn main() {
|
||||||
height: app.ui.height
|
height: app.ui.height
|
||||||
window_title: 'Fireworks!'
|
window_title: 'Fireworks!'
|
||||||
bg_color: gx.black
|
bg_color: gx.black
|
||||||
use_ortho: true
|
|
||||||
user_data: app
|
user_data: app
|
||||||
frame_fn: on_frame
|
frame_fn: on_frame
|
||||||
event_fn: on_event
|
event_fn: on_event
|
||||||
|
|
|
@ -185,7 +185,6 @@ fn main() {
|
||||||
bg_color: gx.white
|
bg_color: gx.white
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'flappylearning-v'
|
window_title: 'flappylearning-v'
|
||||||
frame_fn: frame
|
frame_fn: frame
|
||||||
|
|
|
@ -48,7 +48,6 @@ fn main() {
|
||||||
user_data: &app
|
user_data: &app
|
||||||
width: screen_width
|
width: screen_width
|
||||||
height: screen_height
|
height: screen_height
|
||||||
use_ortho: true
|
|
||||||
create_window: true
|
create_window: true
|
||||||
resizable: false
|
resizable: false
|
||||||
window_title: 'v life (with gg, gx)'
|
window_title: 'v life (with gg, gx)'
|
||||||
|
|
|
@ -74,7 +74,6 @@ fn main() {
|
||||||
app.gg = gg.new_context(
|
app.gg = gg.new_context(
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'Empty window'
|
window_title: 'Empty window'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
|
@ -23,7 +23,6 @@ fn main() {
|
||||||
bg_color: gx.white
|
bg_color: gx.white
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'Rectangles'
|
window_title: 'Rectangles'
|
||||||
frame_fn: frame
|
frame_fn: frame
|
||||||
|
|
|
@ -30,7 +30,6 @@ fn main() {
|
||||||
app.gg = gg.new_context(
|
app.gg = gg.new_context(
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'Counter'
|
window_title: 'Counter'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
|
@ -37,7 +37,6 @@ fn main() {
|
||||||
width: window_width
|
width: window_width
|
||||||
height: window_height
|
height: window_height
|
||||||
font_size: 20
|
font_size: 20
|
||||||
use_ortho: true
|
|
||||||
user_data: game
|
user_data: game
|
||||||
window_title: 'Hot code reloading demo'
|
window_title: 'Hot code reloading demo'
|
||||||
create_window: true
|
create_window: true
|
||||||
|
|
|
@ -23,7 +23,6 @@ fn main() {
|
||||||
width: size
|
width: size
|
||||||
height: size
|
height: size
|
||||||
font_size: 20
|
font_size: 20
|
||||||
use_ortho: true
|
|
||||||
user_data: context
|
user_data: context
|
||||||
window_title: 'Graph builder'
|
window_title: 'Graph builder'
|
||||||
create_window: true
|
create_window: true
|
||||||
|
|
|
@ -211,7 +211,6 @@ fn main() {
|
||||||
user_data: &app
|
user_data: &app
|
||||||
width: canvas_size
|
width: canvas_size
|
||||||
height: top_height + canvas_size
|
height: top_height + canvas_size
|
||||||
use_ortho: true
|
|
||||||
create_window: true
|
create_window: true
|
||||||
resizable: false
|
resizable: false
|
||||||
window_title: 'snek'
|
window_title: 'snek'
|
||||||
|
|
|
@ -418,7 +418,6 @@ fn main() {
|
||||||
app.gg = gg.new_context(
|
app.gg = gg.new_context(
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: '3D Cube Demo'
|
window_title: '3D Cube Demo'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
|
@ -612,7 +612,6 @@ fn main() {
|
||||||
app.gg = gg.new_context(
|
app.gg = gg.new_context(
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: '3D Cube Demo'
|
window_title: '3D Cube Demo'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
|
@ -423,7 +423,6 @@ fn main() {
|
||||||
app.gg = gg.new_context(
|
app.gg = gg.new_context(
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: '3D Ray Marching Cube'
|
window_title: '3D Ray Marching Cube'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
|
@ -619,7 +619,6 @@ fn main() {
|
||||||
app.gg = gg.new_context(
|
app.gg = gg.new_context(
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: '3D Dual shader Cube - click and rotate with the mouse'
|
window_title: '3D Dual shader Cube - click and rotate with the mouse'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
|
@ -506,7 +506,6 @@ fn main(){
|
||||||
app.gg = gg.new_context({
|
app.gg = gg.new_context({
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'Instancing Cube'
|
window_title: 'Instancing Cube'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
|
@ -323,7 +323,6 @@ fn main() {
|
||||||
app.gg = gg.new_context(
|
app.gg = gg.new_context(
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'V Wavefront OBJ viewer - Use the mouse wheel to zoom'
|
window_title: 'V Wavefront OBJ viewer - Use the mouse wheel to zoom'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
|
@ -44,7 +44,6 @@ fn main() {
|
||||||
bg_color: gx.rgb(50, 50, 50)
|
bg_color: gx.rgb(50, 50, 50)
|
||||||
width: 1024
|
width: 1024
|
||||||
height: 400
|
height: 400
|
||||||
use_ortho: true
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'ByteBeat Music'
|
window_title: 'ByteBeat Music'
|
||||||
frame_fn: graphics_frame
|
frame_fn: graphics_frame
|
||||||
|
|
|
@ -167,7 +167,6 @@ fn main() {
|
||||||
bg_color: gx.white
|
bg_color: gx.white
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'V Tetris' //
|
window_title: 'V Tetris' //
|
||||||
user_data: game
|
user_data: game
|
||||||
|
|
|
@ -123,7 +123,6 @@ fn main() {
|
||||||
app.gg = gg.new_context(
|
app.gg = gg.new_context(
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'Test TTF module'
|
window_title: 'Test TTF module'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
|
@ -53,7 +53,7 @@ In this modue it is possible to have different renders running at the same time.
|
||||||
At the present time all the rendering are made on the CPU, sokol is used only to draw the
|
At the present time all the rendering are made on the CPU, sokol is used only to draw the
|
||||||
rendered text to the screen.
|
rendered text to the screen.
|
||||||
Let's start with a simple snippet of code:
|
Let's start with a simple snippet of code:
|
||||||
```v ignore
|
```v oksyntax
|
||||||
import os
|
import os
|
||||||
import x.ttf
|
import x.ttf
|
||||||
[console]
|
[console]
|
||||||
|
@ -70,7 +70,7 @@ This simple code load a TTF font and display its basic informations.
|
||||||
### draw_text
|
### draw_text
|
||||||
The draw text function draw simple strings without indentation or other imagination tasks.
|
The draw text function draw simple strings without indentation or other imagination tasks.
|
||||||
At this point we can render a simple text:
|
At this point we can render a simple text:
|
||||||
```v ignore
|
```v oksyntax
|
||||||
import os
|
import os
|
||||||
import x.ttf
|
import x.ttf
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ Using the low level rendering you need to manage all the amenities like allocate
|
||||||
memory and other tasks like calc the character dimensions.
|
memory and other tasks like calc the character dimensions.
|
||||||
|
|
||||||
You can specify the style for the text rendering in the `BitMap` struct::
|
You can specify the style for the text rendering in the `BitMap` struct::
|
||||||
```v ignore
|
```v
|
||||||
enum Style {
|
enum Style {
|
||||||
outline
|
outline
|
||||||
outline_aliased
|
outline_aliased
|
||||||
|
@ -134,7 +134,7 @@ Use this level only if you want achieve particular result on text rendering.
|
||||||
|
|
||||||
### draw_text_block
|
### draw_text_block
|
||||||
Draw text block draw a justified and indented block of multiline text in the bitmap.
|
Draw text block draw a justified and indented block of multiline text in the bitmap.
|
||||||
```v ignore
|
```v oksyntax
|
||||||
import os
|
import os
|
||||||
import x.ttf
|
import x.ttf
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ But Vwill prevail for sure, V is the way!!
|
||||||
```
|
```
|
||||||
This is the low level render that draw text block on the bitmap.
|
This is the low level render that draw text block on the bitmap.
|
||||||
A text block is defined from a `Text_block` struct:
|
A text block is defined from a `Text_block` struct:
|
||||||
```v ignore
|
```v
|
||||||
struct Text_block {
|
struct Text_block {
|
||||||
x int // x postion of the left high corner
|
x int // x postion of the left high corner
|
||||||
y int // y postion of the left high corner
|
y int // y postion of the left high corner
|
||||||
|
@ -196,7 +196,7 @@ struct Text_block {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
and use the following bitmap fields:
|
and use the following bitmap fields:
|
||||||
```v ignore
|
```v oksyntax
|
||||||
style Style = .filled // default syle
|
style Style = .filled // default syle
|
||||||
align Text_align = .left // default text align
|
align Text_align = .left // default text align
|
||||||
justify bool // justify text flag, default deactivated
|
justify bool // justify text flag, default deactivated
|
||||||
|
@ -211,7 +211,7 @@ the text to the screen.
|
||||||
It is mor esimpel to use in a `gg app` that the raw bitmap render.
|
It is mor esimpel to use in a `gg app` that the raw bitmap render.
|
||||||
Each single text rendered need its own reder to be declared, after you can modify it.
|
Each single text rendered need its own reder to be declared, after you can modify it.
|
||||||
Here a simple example of the usage:
|
Here a simple example of the usage:
|
||||||
```v ignore
|
```v oksyntax
|
||||||
import gg
|
import gg
|
||||||
import gx
|
import gx
|
||||||
import sokol.sapp
|
import sokol.sapp
|
||||||
|
@ -275,7 +275,6 @@ fn main(){
|
||||||
app.gg = gg.new_context({
|
app.gg = gg.new_context({
|
||||||
width: win_width
|
width: win_width
|
||||||
height: win_height
|
height: win_height
|
||||||
use_ortho: true // This is needed for 2D drawing
|
|
||||||
create_window: true
|
create_window: true
|
||||||
window_title: 'Test TTF module'
|
window_title: 'Test TTF module'
|
||||||
user_data: app
|
user_data: app
|
||||||
|
|
Loading…
Reference in New Issue