flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > can someone provide a simple opengl shader tutorial

Goto page Previous  1, 2
Thread Post new topic Reply to topic

Joined: 20 Feb 2006
Posts: 4250
Location: Now
cool!!! Very Happy

can you post the source code please? i'd like to test it Smile

mikokawasaki wrote:
I got it working now....

im posting for anyone interested...

thank you randall for "pointing" that out...
i learned something new...

heres the working shader code thing im using...

invoke wglGetProcAddress,"glCreateShader"
mov [glCreateShader],rax
invoke wglGetProcAddress,"glCreateProgram"
mov [glCreateProgram],rax
invoke wglGetProcAddress,"glShaderSource"
mov [glShaderSource],rax
invoke wglGetProcAddress,"glCompileShader"
mov [glCompileShader],rax
invoke wglGetProcAddress,"glAttachShader" 
mov [glAttachShader],rax
invoke wglGetProcAddress,"glLinkProgram" 
mov [glLinkProgram],rax
invoke wglGetProcAddress,"glUseProgram"
mov [glUseProgram],rax

invoke glCreateShader, GL_FRAGMENT_SHADER
mov [vs],rax
invoke glCreateProgram
mov [prg],rax
invoke glShaderSource,[vs],1,_fshader_ptr,0
invoke glCompileShader,[vs]
invoke glAttachShader,[prg],[vs]
invoke glLinkProgram,[prg]
invoke glUseProgram,[prg]


glGenBuffers dq ?
glCreateShader dq ?
glCreateProgram dq ?
glShaderSource dq ?
glCompileShader dq ?
glAttachShader dq ?
glLinkProgram dq ?
glUseProgram dq ?
vs dq ?
prg dq ?

  align 1
  _fshader db 'void main(){ gl_FragColor = vec4(0.0,0.0,1.0,1.0); }  ',0   
  align 8 
  _fshader_ptr dq _fshader

Post 04 Jun 2013, 20:50
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.