全球旧事资料 分类
使用ope
Gl画直线(DDA算法)、画圆、椭圆(Brese
ham算法)
i
cludestdlibhi
cludeiostreamhi
cludeGLgluth
i
itializatio
voidmyi
itvoid
attributes
glClearColor10101000whitebackgrou
dglColor3f100000drawi
red
setupviewi
g500x500wi
dowwithorigi
lowerleft
glMatrixModeGL_PROJECTIONglLoadIde
titygluOrtho2D005000005000glMatrixModeGL_MODELVIEWvoidplot_circle_poi
tsi
txci
tyci
txi
ty画圆glBegi
GL_POINTSglVertex3fxcxycy0glVertex3fxcxycy0glVertex3fxcxycy0glVertex3fxcxycy0glVertex3fxcyycx0glVertex3fxcyycx0glVertex3fxcyycx0glVertex3fxcyycx0glE
dvoiddrawcirclei
txci
tyci
tradiusi
txypx0yradiusp32radiusglClearGL_COLOR_BUFFER_BITglBegi
GL_POINTS
fwhilexy
plot_circle_poi
tsxcycxyifp0
pp4x6else
pp4xy10y1x1ifxyplot_circle_poi
tsxcycxy
voidputpixeli
txci
tyci
txi
ty画椭圆
glBegi
GL_POINTSglVertex3fxcxycy0glE
dvoiddrawEllipsei
txci
tyci
tai
tbi
txyfloatd1d2x0ybd1bbaab025putpixelxcycxyputpixelxcycxyputpixelxcycxyputpixelxcycxywhilebbx1aay05
ifd10
d1bb2x3xelsed1bb2x3aa2y2
fxyputpixelxcycxyputpixelxcycxyputpixelxcycxyputpixelxcycxyd2bbx05x05aay1y1aabbwhiley0ifd20d2bb2x2aa2y3xyelsed2aa2y3yputpixelxcycxyputpixelxcycxyputpixelxcycxyputpixelxcycxy
voiddda_li
ei
txai
tyai
txbi
tyb画直线
GLfloatdelta_xdelta_yxyi
tdxdystepsdxxbxadyybyaifabsdxabsdy
stepsabsdxelse
stepsabsdydelta_xGLfloatdxGLfloatstepsdelta_yGLfloatdyGLfloatstepsxxayya
fglClearGL_COLOR_BUFFER_BITglBegi
GL_POINTSglVertex3fxy0fori
tk1kstepsk
xdelta_xydelta_yglBegi
GL_POINTSglVertex3fxy0glE
d
thedisplaycallbackvoiddisplay1画圆
glClearGL_COLOR_BUFFER_BIT
clearthewi
dow

viewportstuff


setupaviewporti
thescree
wi
dow
argstoglViewportareleftbottomwidthheight
glViewport00500500
NBdefaultviewporthassamecoordsasi
myi
it
sothiscouldbeomitted
dda_li
e2020420350
a
dflushthatbuffertothescree
glFlush
voiddisplay2画圆
glClearGL_COLOR_BUFFER_BITclearthewi
dow

viewportstuff


setupaviewporti
thescree
wi
dor
好听全球资料 返回顶部