File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 4
4
<i class =" pi pi-play" style =" font-size : 5rem " ></i > <br />
5
5
<h4 >Click here to start the emulation</h4 >
6
6
</div >
7
- <div v-show =" loading == 1" >
8
- <canvas class =" shadow-3 gamecanvas" ref =" gamecanvas" ></canvas >
7
+ <div ref =" gamediv" style =" width : 100% " v-show =" loading == 1" >
8
+ <canvas
9
+ height =" 240"
10
+ width =" 256"
11
+ class =" shadow-3 gamecanvas"
12
+ ref =" gamecanvas"
13
+ ></canvas >
9
14
</div >
10
15
</div >
11
16
</template >
@@ -70,8 +75,8 @@ export default {
70
75
gamerom: null ,
71
76
fps: 60 ,
72
77
ticks: 0 ,
73
- height: 432 ,
74
- width: 480 ,
78
+ height: 240 ,
79
+ width: 256 ,
75
80
loaded: false ,
76
81
loadedFile: null ,
77
82
paused: false ,
@@ -511,12 +516,13 @@ class WebGLRenderer {
511
516
const gl = (this .gl = el .getContext (" webgl2" , {
512
517
preserveDrawingBuffer: true ,
513
518
}));
519
+ console .log (gl);
514
520
if (gl === null ) {
515
521
throw new Error (" unable to create webgl context" );
516
522
}
517
523
518
- const w = SCREEN_WIDTH / 256 ;
519
- const h = SCREEN_HEIGHT / 256 ;
524
+ const w = 256 / 256 ;
525
+ const h = 240 / 256 ;
520
526
const buffer = gl .createBuffer ();
521
527
gl .bindBuffer (gl .ARRAY_BUFFER , buffer);
522
528
gl .bufferData (
@@ -651,7 +657,7 @@ class WebGLRenderer {
651
657
652
658
/* Fill the available space */
653
659
width : 100% ;
654
- /* Original resolution ratio */
660
+ /* Original resolution ratio */
655
661
aspect-ratio : 256 / 240 ;
656
662
657
663
margin : 0 ; /* binjgb */
You can’t perform that action at this time.
0 commit comments